Repository navigation
[Typing] Python type stubs - #218
Merged
Merged
Conversation
* quantities.units.puressure.barad * quantities.units.volume.milliliter
* use quantities.umath.__all__ * ignore UnitQuantity.__hash__ * fix aliases as list[str] in golden_ratio (but not used) * dtype of npt.NDArray must be generic
Contributor
|
Many thanks for pushing this over the line @n-takumasa ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I am hoping that the great PR(#206) will be merged sooner.
So, I prepare some changes until mypy and pytest passed.
Notes
Duplicate definitions. eg.: volume.py#L14 & volume.py#L38
The same abbreviation is assigned to different units.
printers_point @ length.py#L133 & US_liquid_pint @ volume.py#L100
I think
npt.NDArray[Union[np.floating, np.integer]]will solve.FYI: There is no need to write
float | intsincefloatalso acceptsint.https://peps.python.org/pep-0484/#the-numeric-tower
from ... import *is the root cause, the next cause is duplicate variable and module names.It doesn't seem to be used, but I think it should be
list[str]because it is confusing.