-
Notifications
You must be signed in to change notification settings - Fork 340
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
Create plasmapy.dispersion.dispersionsolver & associated functionality #932
Conversation
renamed: plasmapy/formulary/dispersionfunction.py -> plasmapy/dispersion/dispersionfunction.py
modified: plasmapy/formulary/__init__.py
modified: plasmapy/formulary/dielectric.py
Updated the notebook to reflect the new location of dispersion.py file in the plasmapy
modified: docs/api_static/plasmapy.formulary.rst renamed: docs/formulary/dispersionfunction.rst -> docs/dispersion/dispersionfunction.rst new file: docs/dispersion/index.rst modified: docs/formulary/index.rst modified: plasmapy/dispersion/tests/test_dispersion.py
@AhmadRyan Ok, I think I've finished updating the tests and the jupyter notebook. For the notebook I added more background of the dispersion relation, updated the plots so they work better with RTD, and added a section that duplicates Figure 1 of Bellan 2012. If you don't mind giving it a read through to ensure everything makes sense and reads correctly, then that would be much appreciated. No matter how many time I reread the things I write I always seem to miss wordage that make me go 🤦🏻♂️. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! And thank you for working on this! Most of my comments are pretty minor, like spelling or capitalization. The only substantive comment is that it'd be helpful to use the @particle_input
decorator instead of having code in the function that does the processing and checking of particles.
if not isinstance(ion, Particle): | ||
try: | ||
ion = Particle(ion) | ||
except TypeError: | ||
raise TypeError( | ||
f"For argument 'ion' expected type {Particle} but got {type(ion)}." | ||
) | ||
if not (ion.is_ion or ion.is_category("element")): | ||
raise ValueError(f"The particle passed for 'ion' must be an ion or element.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest using the @particle_input
decorator, since that will handle everything here. If the argument's name is ion
, then @particle_input
will even verify that it is an ion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't mind, I'd like to add @particle_input
after we develop and deploy particle_like
. @particle_input
just doesn't play well with other decorators so I'd like to avoid unforeseen complications until @particle_input
goes through its update.
Co-authored-by: Nick Murphy <[email protected]>
@namurphy Thanks for the quick read through! I'm going to leave the PR open for now to give @AhmadRyan a chance to read through and comment. I'm hoping we'll merge Monday or Tuesday. |
@rocco8773 @namurphy I guess we can merge this to the main branch of PlasmaPy during today's meeting! |
@AhmadRyan Sure, I can do it during our call. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
docstrings.