enthought / enthought/scimath

Provides trait types that support unit groups

Open
#32 0 comments 0 reactions 0 assignees View on GitHub
Enhancement
Dominant language
Python
Stars
66
Forks
13
PR merge metrics
No merged PRs in 30d

Description

It would be convenient if we could define TraitTypes that validate units based on the a quantity

e.g.

``` python
from scimath.units.length import Length, feet, meters
from scimath.units.mass import kg

class MyClass(HasTraits):

unit = Length(feet)

my_class = MyClass()

# This is valid
my_class.unit = meters

# This is invalid
my_class.unit = kg
```

The trait might be as simple as an Enum with all the available unit objects.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.