The objective is to handle cell densities expressed as "1000/mm^3", i.e. thousands per cubic millimeter.
Currently I do this to handle "1/mm^3":
import quantities as pq
d1 = pq.Quantity(500000, "1/mm**3")
which gives:
array(500000) * 1/mm**3
But what I really need to do is to accept the values with units of "1000/mm^3". This should also be the form in which values are printed. When I try something like:
d1 = pq.Quantity(5, 1000/pq.mm**3)
I get the following error:
ValueError: units must be a scalar Quantity with unit magnitude, got 1000.0 1/mm**3
And if I try:
a = pq.Quantity(500, "1000/mm**3")
The output is:
array(500) * 1/mm**3
i.e. The 1000
just gets ignored.
Any idea how can I fix this? Any workaround?
(The requirement arises from the standard practice followed in the domain.)