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

Create plasmapy.dispersion.dispersionsolver & associated functionality #932

Merged
merged 181 commits into from
Jan 21, 2021
Merged

Create plasmapy.dispersion.dispersionsolver & associated functionality #932

merged 181 commits into from
Jan 21, 2021

Conversation

qudsiramiz
Copy link
Member

@qudsiramiz qudsiramiz commented Oct 13, 2020

  • I have added a changelog entry for this pull request.
  • If adding new functionality, I have added tests and
    docstrings.
  • I have fixed any newly failing tests.

Ramiz Qudsi added 30 commits June 10, 2020 14:35
	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
@rocco8773
Copy link
Member

@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 🤦🏻‍♂️.

Copy link
Member

@namurphy namurphy left a 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.

docs/notebooks/dispersion/two_fluid_dispersion.ipynb Outdated Show resolved Hide resolved
docs/notebooks/dispersion/two_fluid_dispersion.ipynb Outdated Show resolved Hide resolved
docs/notebooks/dispersion/two_fluid_dispersion.ipynb Outdated Show resolved Hide resolved
docs/notebooks/dispersion/two_fluid_dispersion.ipynb Outdated Show resolved Hide resolved
docs/notebooks/dispersion/two_fluid_dispersion.ipynb Outdated Show resolved Hide resolved
Comment on lines +230 to +238
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.")
Copy link
Member

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.

Copy link
Member

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.

plasmapy/dispersion/two_fluid_dispersion.py Show resolved Hide resolved
plasmapy/dispersion/two_fluid_dispersion.py Show resolved Hide resolved
plasmapy/dispersion/two_fluid_dispersion.py Outdated Show resolved Hide resolved
plasmapy/dispersion/two_fluid_dispersion.py Outdated Show resolved Hide resolved
@rocco8773
Copy link
Member

@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.

@qudsiramiz
Copy link
Member Author

@rocco8773 @namurphy I guess we can merge this to the main branch of PlasmaPy during today's meeting!
Thank you for the code review and all the suggestions!

@rocco8773
Copy link
Member

@AhmadRyan Sure, I can do it during our call. 👍

Copy link
Member

@rocco8773 rocco8773 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@rocco8773 rocco8773 merged commit 5a2b99b into PlasmaPy:master Jan 21, 2021
@qudsiramiz qudsiramiz deleted the dsolver branch October 20, 2021 16:01
@qudsiramiz qudsiramiz restored the dsolver branch October 20, 2021 16:01
@qudsiramiz qudsiramiz deleted the dsolver branch October 20, 2021 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plasmapy.dispersion Related to the plasmapy.dispersion subpackage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants