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

Avoid repeating the creation of EigenData instances #35

Merged
merged 2 commits into from
Aug 13, 2020

Conversation

namurphy
Copy link
Member

This PR moves the creation of EigenData instances from the NEI class to the file that EigenData is defined in. Before this, every time NEI was instantiated, a new dictionary containing eigendata arrays was calculated, which slowed things down when running models. This will slow down the import of plasmapy_nei, but this should speed up running models. Ultimately, the eigendata should be put into a new HDF5 file so that it does not need to be calculated.

This heretofore was being created in the NEI class, which slowed down
execution.  By moving it to eigenclass.py, it should only run once on
import.

Ultimately, this should be relegated to an HDF5 file so that the
calculations need not be repeated.  It could also be helpful to store
this information in the new data classes available from Python 3.7 on.
@pep8speaks
Copy link

pep8speaks commented Aug 13, 2020

Hello @namurphy! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-08-13 16:07:21 UTC

@namurphy
Copy link
Member Author

The html doc builds in CircleCI are failing for a different problem described in #37.

@namurphy namurphy merged commit 633d8c1 into PlasmaPy:master Aug 13, 2020
@namurphy namurphy deleted the move-dict branch August 13, 2020 16:30
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.

2 participants