You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be convenient if we could define TraitTypes that validate units based on the a quantity
e.g.
fromscimath.units.lengthimportLength, feet, metersfromscimath.units.massimportkgclassMyClass(HasTraits):
unit=Length(feet)
my_class=MyClass()
# This is validmy_class.unit=meters# This is invalidmy_class.unit=kg
The trait might be as simple as an Enum with all the available unit objects.
The text was updated successfully, but these errors were encountered:
It would be convenient if we could define TraitTypes that validate units based on the a quantity
e.g.
The trait might be as simple as an Enum with all the available unit objects.
The text was updated successfully, but these errors were encountered: