python-quantities/python-quantities — Issue #36: Units raised to zero exponent not returning dimensionless
Author: mikehulluk
Created: 2012-01-26 15:02:33+00:00
State: open

Raising units to power zero does not lead to dimensionless units.
For example:

In [1]: import quantities as pq

In [2]: pq.m ** 0
Out[2]: array(1.0) * m

In [3]: pq.m ** 1
Out[3]: array(1.0) * m

In [4]: pq.m ** -1
Out[4]: array(1.0) * 1/m

In [5]: pq.m /pq.m
Out[5]: array(1.0) * dimensionless

I would expect
In [2]: pq.m **2
to return
Out[5]: array(1.0) * dimensionless