Get all matching units from string

59 Views Asked by At

I am using pint 0.23 and I faced the following problem.

I have a unit in short format (dat). It can refer to deci-technical_atmosphere or deca-metric_ton. Here is what I do at the moment

>> import pint
>> ureg = pint.UnitRegistry()
>> d = "[denisty]"
>> ureg.Unit("dat")
<Unit('decitechnical_atmosphere')>

How can I force it to give me the deca-metric_ton as it should be a [density]?

0

There are 0 best solutions below