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

IonicFraction refactor #1046

Merged
merged 11 commits into from
Mar 12, 2021

Conversation

StanczakDominik
Copy link
Member

@StanczakDominik StanczakDominik commented Feb 26, 2021

Starting to apply changes to IonicFraction from
#1020 (reply in thread). Refactoring the implementation a little along the way. Part of #1059.

  • docs for T_i will go in at a future time, along with that feature!

@StanczakDominik StanczakDominik added plasmapy.particles Related to the plasmapy.particles subpackage refactoring ♻️ Improving an implementation without adding new functionality labels Feb 26, 2021
@codecov
Copy link

codecov bot commented Feb 26, 2021

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.89%. Comparing base (6e2221b) to head (c3f4980).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1046      +/-   ##
==========================================
- Coverage   96.89%   96.89%   -0.01%     
==========================================
  Files          70       70              
  Lines        6920     6918       -2     
==========================================
- Hits         6705     6703       -2     
  Misses        215      215              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@StanczakDominik StanczakDominik modified the milestones: 0.6.0, 0.7.0 Mar 10, 2021
@StanczakDominik StanczakDominik marked this pull request as ready for review March 12, 2021 19:33
@StanczakDominik StanczakDominik requested a review from a team March 12, 2021 19:34
@StanczakDominik StanczakDominik changed the title IonicFraction refactor, temperatures IonicFraction refactor Mar 12, 2021
@StanczakDominik StanczakDominik enabled auto-merge (squash) March 12, 2021 19:49
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.

Thank you again for doing this!

My main comment is that we should keep the same name for the attributes originally named ionic_fraction, since the ionic fraction is the fraction of the atoms of an element that are at that ionic level. Renaming the IonicFraction class to IonicLevel is what we want to do, since IonicLevel contains the ionic fraction as well as some other properties. For an example of the naming (at least for the way heliophysicists tend to use it)... He 1+ is the ionic level. If half of the helium is at that ionic level, then the ionic fraction would be 0.5.

If you request another review then I should be able to get to this pretty quickly.

ionic_fraction: real number between 0 and 1, optional
ionic_level: real number between 0 and 1, optional
Copy link
Member

Choose a reason for hiding this comment

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

For the attribute, I'd keep the name as ionic_fraction since it's the fraction of the element/isotope that's at this ionic level.

plasmapy/particles/ionization_state.py Show resolved Hide resolved
@@ -166,7 +164,7 @@ class IonizationState:
an element, isotope, or ion; or an integer representing the
atomic number of an element.

ionic_fractions: `~numpy.ndarray`, `list`, `tuple`, or `~astropy.units.Quantity`; optional
ionic_levels: `~numpy.ndarray`, `list`, `tuple`, or `~astropy.units.Quantity`; optional
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ionic_levels: `~numpy.ndarray`, `list`, `tuple`, or `~astropy.units.Quantity`; optional
ionic_fractions: `~numpy.ndarray`, `list`, `tuple`, or `~astropy.units.Quantity`; optional

This also should be changed back to ionic_fractions.

Copy link
Member Author

Choose a reason for hiding this comment

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

The argument, but not the field of IonizationState, if I understand correctly?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, okay, I get it now. Sorry, tired.

plasmapy/particles/ionization_state.py Outdated Show resolved Hide resolved
@StanczakDominik
Copy link
Member Author

Gah, you're of course right; that's just overzealous grepping. Getting to it.

@StanczakDominik
Copy link
Member Author

That should do it! Sorry I didn't pay enough attention to this.

@StanczakDominik StanczakDominik merged commit fdcf31a into PlasmaPy:master Mar 12, 2021
rocco8773 added a commit to rocco8773/PlasmaPy that referenced this pull request Mar 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plasmapy.particles Related to the plasmapy.particles subpackage refactoring ♻️ Improving an implementation without adding new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants