tlkenergy / sim-tlk

Roadmap and Issues for sim.TLK cloud based system simulation
2 stars 1 forks source link

No "DisplayUnits" for bar/ column charts - Custom Operations? #41

Closed Walshest closed 1 year ago

Walshest commented 1 year ago

It is not possible to select display units fo bar /column plots:

image

Therefore want use custom operations to convert from EUR -> kEUR However this doesn't work:

image

How do you correctly use the custom operations`?

seschweiler commented 1 year ago

All outputs automatically have a unit, which is read from the model description. The "yUnit" defines the display unit, which of course needs to match the quantity of the output. For example, if we have an output that describes a mass it should have the SI unit kg (this info is stored in the "Model Outputs" field of the FMU and can be seen on the Django Admin page). For this output, the available yUnits should be all mass units such as "g" or "mg". "€" does not seem to be supported by Modelica as unit.

If an output does not have a physical unit (unit: 1), all units are available as yUnit. The custom operation can be used to set up a custom unit conversion. The example from your screenshot looks correct to me. What exactly does not work?

Walshest commented 1 year ago

Yes exactly that is the issue that it doesn't define the unit.

See error information here:

image

I can forward the full email if you need?

seschweiler commented 1 year ago

Ah, I think I know what the problem is. You need to use Pandas operations: 'a.div(1000)'

Walshest commented 1 year ago

Perfect! That worked, thanks a million :)

image