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

Decorate two_fluid dispersion solver with @particle_input #2022

Merged
merged 17 commits into from May 31, 2023

Conversation

namurphy
Copy link
Member

Description

This PR decorates plasmapy.dispersion.analytical.two_fluid_.two_fluid with @particle_input.

A new capability is that two_fluid will now accept mass_numb separately from ion.

There are some breaking changes:

  • The z_mean parameter got changed to Z for two_fluid (for consistency with how we're handling the charge number
  • z_mean will no longer override the charge provided in ion (since having contradictory arguments make code confusing to read without referring to the docstring)
  • The charge number will no longer default to 1 (to avoid implicit particle assumptions)

Motivation and context

Using @particle_input here will allow us to drop two blocks of code which were validating ion and z_mean. Plus, using the mechanics allowed by @particle_input will give a more consistent user experience across subpackages.

Related issues

This is motivated by #1869, which at present is marking some z_mean override tests as expecting to fail.

This is an offshoot of #341, except for plasmapy.dispersion instead of plasmapy.formulary.

@namurphy namurphy added plasmapy.dispersion Related to the plasmapy.dispersion subpackage Breaking labels Mar 17, 2023
@codecov
Copy link

codecov bot commented Mar 17, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01 ⚠️

Comparison is base (a2de23c) 98.31% compared to head (f6679dd) 98.31%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2022      +/-   ##
==========================================
- Coverage   98.31%   98.31%   -0.01%     
==========================================
  Files          98       98              
  Lines        8622     8608      -14     
==========================================
- Hits         8477     8463      -14     
  Misses        145      145              
Impacted Files Coverage Δ
plasmapy/dispersion/analytical/two_fluid_.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

The charge number is now contained in `ion`.
@namurphy namurphy changed the title Decorate two_fluid with @particle_input Decorate two_fluid dispersion solver with @particle_input Mar 17, 2023
The ones from that are positional are all distinguishable by
unit or particle-like-ness, so having allowing it to be
positional is not likely to cause any problems.
@namurphy namurphy added breaking change For breaking changes, excluding deprecations and planned removals status: in progress and removed breaking labels May 23, 2023
@namurphy namurphy modified the milestones: 2023.5.0, 2023.9.0 May 26, 2023
@namurphy namurphy added the size: large 100 ≤ changed lines < 500 label May 26, 2023
Copy link
Contributor

@ejohnson-96 ejohnson-96 left a comment

Choose a reason for hiding this comment

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

👍 could users possible get confused between charge state and z mean?

@namurphy
Copy link
Member Author

+1 could users possible get confused between charge state and z mean?

My hope is that by implementing @particle_input everywhere and switching from z_mean to Z will make it a more consistent user experience overall.

Thank you as always for the reviews!

@namurphy namurphy merged commit fca4155 into PlasmaPy:main May 31, 2023
14 checks passed
@namurphy namurphy deleted the dispersion-particle-input-two-fluid branch May 31, 2023 17:56
@github-actions github-actions bot removed the status: ready for review PRs that are ready for code review label May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change For breaking changes, excluding deprecations and planned removals plasmapy.dispersion Related to the plasmapy.dispersion subpackage size: large 100 ≤ changed lines < 500 testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants