-
Notifications
You must be signed in to change notification settings - Fork 339
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
Refactoring plasmapy.dispersion structure #1208
Conversation
…on.py new file: plasmapy/dispersion/other_methods/Hirose_Equation.py new file: plasmapy/dispersion/other_methods/Hollweg_dispersion_equation.py
…on/analytical/two_fluid.py
Codecov Report
@@ Coverage Diff @@
## main #1208 +/- ##
=======================================
Coverage ? 96.99%
=======================================
Files ? 73
Lines ? 7053
Branches ? 0
=======================================
Hits ? 6841
Misses ? 212
Partials ? 0 Continue to review full report at Codecov.
|
changelog/1208.breaking.rst
Outdated
Reorganization of `~plasmapy.dispersion.two_fluid_dispersion_solution`, | ||
The analytical solution file has been moved to a new folder inside | ||
PlasmaP/plasmapy/dispersion/ called `analytical` and the file it self has been | ||
renamed from two_fluid_dispersion_solution.py to two_fluid.py |
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.
break this into two change logs
1208.feature.rst
Restructuring of the `plasmapy.dispersion` subpackage by creating the
`~plasmapy.dispersion.analytical` subpackage to contain functionality
related to analytical dispersion solutions.
1208.breaking.rst
Renamed file ``two_fluid_dispersion.py`` to ``two_fluid.py`` and moved into
the ``plasmapy.dispersion.analytical`` subpackage. The contained function
``two_fluid_dispersion_solutions()`` was also renamed to
`~plasmapy.dispersion.analytical.two_fluid.two_fluid`.
@@ -1,4 +1,8 @@ | |||
__all__ = ["two_fluid_dispersion_solution"] | |||
""" |
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.
So we have a bit of a naming conflict between two_fluid
the file and two_fluid
the function. This currently doesn't cause major issues but will lead to unexpected behavior for documentation and importing. With the current code, two_fluid
the file could never be imported because two_fluid
is always overwritten as the function by
from plasmapy.dispersion.analytical.two_fluid import two_fluid
in plasmapy/dispersion/analytical/__init__.py
. My proposed solution is to rename two_fluid.py
to two_fluid_.py
. In python the trailing underscore is often used to avoid naming conflicts when reasonable differing names can't be created for similar objects.
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.
Can you add a module level docstring to dispersionfunction.py
? The top of the file should look something like...
"""
Module containing functionality focused on the plasma dispersion function
:math:`Z(ζ)`.
"""
__all__ = ["plasma_dispersion_func", "plasma_dispersion_func_deriv"]
import astropy.units as u
import numbers
import numpy as np
...
If you do this and..
- break up the change log entries like we discussed during office hours
- resolve the
two_fluid
naming conflict (i.e.two_fluid.py
->two_fluid_.py
)
then we can merge.
…rsion.analytical.two_fluid_.rst
I've made these changes and all the checks passed (except the numpy and xarray checks we discussed last week). |
Co-authored-by: Erik Everson <[email protected]>
Co-authored-by: Erik Everson <[email protected]>
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.
Alright, this looks good! Thank you for sticking with this. As soon as all the checks pass I'll merge it. Congrats on your first successful PR!!! 🎉
This PR refactors the
plasmapy.dispersion
structure ...plasmapy.dispersion.analytical
plasmapy.dispersion.numerical
plasmapy.dispersion.two_fluid_dispersion
->plasmapy.dispersion.analytical.two_fluid
two_fluid_dispersion_solution
->two_fluid