-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refactor_24' into unit_parsing
- Loading branch information
Showing
18 changed files
with
858 additions
and
143 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
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
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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
from typing import TypeVar | ||
|
||
from quantities.quantity import BaseQuantity | ||
from quantities.quantity import Quantity | ||
from sasdata.quantities.accessors import TemperatureAccessor | ||
|
||
|
||
DataType = TypeVar("DataType") | ||
class AbsoluteTemperatureAccessor(TemperatureAccessor[DataType]): | ||
""" Parsing for absolute temperatures """ | ||
@property | ||
def value(self) -> BaseQuantity[DataType] | None: | ||
def value(self) -> Quantity[DataType] | None: | ||
if self._numerical_part() is None: | ||
return None | ||
else: | ||
return BaseQuantity.parse(self._numerical_part(), self._unit_part(), absolute_temperature=True) | ||
return Quantity.parse(self._numerical_part(), self._unit_part(), absolute_temperature=True) |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Mutability | ||
---------- | ||
|
||
DataSets: Immutable | ||
Quantities: Immutable | ||
Units: Hard coded | ||
|
||
Quantity methods | ||
---------------- | ||
|
||
in_* methods return numbers/arrays in a given unit system | ||
to_* converts to different units | ||
|
||
|
||
Identifying of Quantities | ||
-------------------- | ||
|
||
There are two choices when it comes to keeping track of quantities for error propagation. | ||
Either we give them names, in which case we risk collisions, or we use hashes, which can potentially | ||
have issues with things not being identified correctly. | ||
|
||
The decision here is to use hashes of the data, not names, because it would be too easy to | ||
give different things the same name. |
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
Oops, something went wrong.