ufo-kit/concert — pull request #9 by matze (2013-08-09 07:39:06+00:00)
Title: Replace quantities with pint

The quantities package is nice "but extremely slow". This
``` python
timeit.timeit("b=a.simplified.magnitude", setup="import quantities as
q;a = 123 * q.mm", number=1000)/1000.0
```
results in 0.5 ms per conversion. Moreover, quantities has a hard dependency on Numpy which I don't like too much.

This change replaces quantities with [pint](https://github.com/hgrecco/pint):

- To hide future changes, I added `concert.quantities` which exports one module variable called `q`. In the future we can easily exchange the implementation without requiring users to change their code. But this also means, that we have to change the current imports from `import quantities as q` to `from concert.quantities import q`.
- pint is a bit more picky about "type safety", e.g. comparing quantities against simple numbers is not possible anymore.
- pint also does not support number per unit quantities, so we need to replace something like `1 / q.mm` by either `q.dimensionless / q.mm` or `q.count / q.mm`. For motors I prefer the latter, because counts should easily map to steps.