You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently pi_mixin writes unit_unknown in the timeseries header during export.
please write a proper unit if known based on the SI specification as used in the Modlica model.
Currently both flow and volume, typically expressed in m3/s and m3, have the same unit_unknown, which gives trouble on the Fews-side when I have to convert this to ML/day (multiply by 86.4) vs. ML (multiply by 0.01)
Please fix in version 2.3 and higher
The text was updated successfully, but these errors were encountered:
This is rather problematic as pymoca does not parse all this Modelica SI-units stuff.
Three solutions could be envisioned:
extend pymoca to deal with it (= lot's of work)
extend rtcDataConfig with a unit field
for optimization:
the pi.post() function retrieves a unit from the timeseries_import dict unless the unit is specified at during a set_timeseries operation.
including your result timeseries as part of the timeseries_import ensures that the proper header info including unit is utilized
for simulation, inclusion of the result timeseries as part of timeseries_import creates a warning and computation failure as the code currently handles all those series as input and it cannot deal with the nan's specified. the solution is:
in the post() function of the script, add the following before calling super().post():
extra_units = {}
for var in self.get_output_variables():
if '.Q' in var or '_Q' in var:
extra_units[var] = 'm3/s'
elif '.V' in var or '_V' in var:
extra_units[var] = 'm3'
for var, unit in extra_units.items():
for alias in self.alias_relation.aliases(var):
self.timeseries_import.set_unit(alias, unit, 0)
In case partial history was present, the delay expressions with missing
values were correctly logged a warning for. However, in case no history
was provided at all, these warnings were not logged due to the if-check
not catching this. This commit makes sure that warnings are logged also
in that scenario.
Closes#1130
In GitLab by @gijsber on Jan 22, 2020, 09:40
Currently pi_mixin writes unit_unknown in the timeseries header during export.
please write a proper unit if known based on the SI specification as used in the Modlica model.
Currently both flow and volume, typically expressed in m3/s and m3, have the same unit_unknown, which gives trouble on the Fews-side when I have to convert this to ML/day (multiply by 86.4) vs. ML (multiply by 0.01)
Please fix in version 2.3 and higher
The text was updated successfully, but these errors were encountered: