-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf95f84
commit 0a8464a
Showing
3 changed files
with
21 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,5 @@ dependencies: | |
- uncertainties | ||
|
||
# Typing | ||
- mypy | ||
- mypy =1.9 | ||
- types-setuptools |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
from typing import overload | ||
|
||
import numpy | ||
|
||
class Unit: | ||
def __init__(self, *args, **kwargs): ... | ||
def __mul__(self, other: int | float | numpy.ndarray) -> Quantity: ... | ||
__rmul__ = __mul__ | ||
|
||
class Quantity: | ||
def __init__(self, *args, **kwargs): ... | ||
def to(self, unit: str | Unit = "dimensionless") -> Quantity: ... | ||
def to_base_units(self, unit: str | Unit = "dimensionless") -> Quantity: ... | ||
def is_compatible_with(self, unit: str | Unit) -> bool: ... | ||
@property | ||
def units(self) -> Unit: ... | ||
|
||
# lists are cast to ndarray | ||
def m(self) -> float | int | numpy.ndarray: ... | ||
def m_as(self) -> float | int | numpy.ndarray: ... | ||
|
||
magnitude = m |