Repository navigation
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2429 +/- ##
==========================================
- Coverage 96.92% 96.91% -0.02%
==========================================
Files 104 104
Lines 9153 9169 +16
==========================================
+ Hits 8872 8886 +14
- Misses 281 283 +2 ☔ View full report in Codecov by Sentry. |
| arg: ParticleLike, | ||
| *, | ||
| mass_numb: Optional[Integral] = None, | ||
| mass_numb: Optional[int] = None, |
There was a problem hiding this comment.
I was surprised that objects from numbers aren't intended to be used with static type checking with mypy (PEP 484). There are constructs like typing.SupportsInt which can be used.
plasmapy/particles/tests/test_atomic.py:417: note: Types from "numbers" aren't supported for static type checking
plasmapy/particles/tests/test_atomic.py:417: note: See https://peps.python.org/pep-0484/#the-numeric-tower
plasmapy/particles/tests/test_atomic.py:417: note: Consider using a protocol instead, such as typing.SupportsFloat
|
I think a problem here is that since |
|
This is partially superseded by #2443. |
|
This one got superseded by or jumbled together with some other PRs, so I'm closing this. |
Description
This PR makes some incremental improvements to typing in
plasmapy.particleswith help frommypy.Motivation and context
Instead of adding types all at once, it's preferable to add them in small, more reviewable chunks.
Related issues
#268, #2424