Skip to content

Units in models and parsers #84

@NicolasGensollen

Description

@NicolasGensollen

A few unit related problems I noticed:

  • Unit conversions are currently managed in the parsers (most of the time hardcoded when setting the attribute value), which is hard to maintain.

Ex:

#From cyme reader
api_winding.nominal_voltage=float(settings['primarybasevoltage'])*10**3 #DiTTo in volt
  • Attribute units are not clear when looking at the DiTTo model. Sometimes there is some indication in the help but not always. In addition some names are misleading in terms of the unit assumed by DiTTo.

Ex:

#In KVA or VA???
normhkva = Float(help='Normal maximum kVA rating for H winding', default_value=None)

These are already introducing some bugs in the conversions and it will probably get worse as we add more parsers...

Having a more robust framework to handle units (like Pint maybe??) would be a nice addition in my opinion. Thoughts?

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions