enthought / enthought/scimath

Automatic construction of unit label via `*` and `/` operations

Open
#45 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

Given two units with defined labels, infer a new label when two units are multiplied or divided. Especially useful for user-defined units

```
from scimath.units.time import hour
from scimath.units.length import cm
hour.label = 'hr'
cm.label = 'cm'
cm_per_hour = cm / hour
print cm_per_hour.label # Currently '', but would be ideally 'cm/hr'
print cm_per_hour # '2.77777777778e-06*m*s**-1'
```

The behavior here isn't completely well defined, such as when we come to say units dealing with the same object of measure (e.g. m / cm shouldn't be 'm/cm'), but at the same time some user facing applications would rather not see `2.777777777777778e-06*m*s**-1`

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.