Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uses numpy inf instead of LARGE_NUMBER #213

Merged
merged 4 commits into from
Feb 17, 2022
Merged

uses numpy inf instead of LARGE_NUMBER #213

merged 4 commits into from
Feb 17, 2022

Conversation

tylerflex
Copy link
Collaborator

Previously, we defined td.inf to point to a LARGE_NUMBER defined in components/constants.py. This got the job done but had a few downsides:

  • Was not explicit in the data files whether a number was just large or was supposed to be infinite.
  • Needed to still be careful we got expected behavior if comparing this with another number that happened to be large (like frequencies in Hz).

This PR sets td.inf = np.inf, which seems to write to json fine.
The visualizations also render correctly.

I had to add a @staticmenthod in Geometry to evaluate the infinity values as LARGE_NUMBER in before setting axes limits as matplotlib could not handle this.

Everything else should be good to go.

@tylerflex tylerflex merged commit 9c9be29 into develop Feb 17, 2022
@tylerflex tylerflex deleted the tyler/inf branch March 25, 2022 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant