-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
HacktoberfestIn celebration of open sourceIn celebration of open sourcehelp wantedExtra attention is neededExtra attention is neededneeds design feedbackDesign implementation needs feedbackDesign implementation needs feedback
Description
The ValueType class (in parametrics.py module) should inherit the UnitRegistry behavior from pint and astropy and still be a subclass of ModelElement. ValueType can be implemented as either a decorated class or subclass that inherits from both UnitRegistry objects/classes.
e.g.,
>>> kesselrun = 12*ValueType('parsecs')
>>> kesselrun
<ValueType(12, 'parsec')>
>>> kesselrun.magnitude
12
>>> str(kesselrun.units)
'parsec'
>>> kesselrun.to('lightyear')
<ValueType(39.138799173399406, 'light_year')>
>>> 2*kesselrun
<ValueType(24, 'parsec')>
>>> type(kesselrun)
ValueType
>>> isinstance(kesselrun, ModelElement)
True
Additional unit tests welcome.
Metadata
Metadata
Assignees
Labels
HacktoberfestIn celebration of open sourceIn celebration of open sourcehelp wantedExtra attention is neededExtra attention is neededneeds design feedbackDesign implementation needs feedbackDesign implementation needs feedback