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
Improve type hint annotations to plasmapy.particles
#2458
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2458 +/- ##
=======================================
Coverage 96.93% 96.93%
=======================================
Files 104 104
Lines 9163 9165 +2
=======================================
+ Hits 8882 8884 +2
Misses 281 281 ☔ View full report in Codecov by Sentry. |
plasmapy.particles.atomic
plasmapy.particles
2fd96ef
to
6bbe7b1
Compare
|
||
|
||
def _physical_particle_factory( | ||
*args, **kwargs | ||
*args: ParticleLike | u.Quantity | CustomParticle | Sequence[ParticleLike], |
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 thought about creating a type alias variable for all of this since it gets repeated, but if we make _physical_particle_factory
into a public function, the type alias variable would need to also be public so that the documentation build doesn't break...I think.
...since it was breaking the documentation build.
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.
👍
This PR is part of the process of adding & correcting type hints in
plasmapy.particles
, as a follow-up to my prior attempt in #2429.I started this PR by using MonkeyType to generate type hints based on the types of variables while running pytest. I also made some manual updates following this.