Skip to content

Commit

Permalink
Added optional comment for lbl-srg#389 (lbl-srg#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwetter authored Nov 11, 2020
1 parent 0a881fe commit 797f8cd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
2 changes: 2 additions & 0 deletions buildingspy/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ BuildingsPy Changelog
Version 2.2.0, xxx, 2020 -- Release 2.2
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- xxx
- For unit tests, added optional comment that is printed if a model is excluded from
the tests (https://github.com/lbl-srg/BuildingsPy/issues/389)
- Corrected generation of package.order for constant arrays (https://github.com/lbl-srg/BuildingsPy/issues/387)
- Refactored class buildingspy.simulate.Dymola, and added buildingspy.simulate.Optimica
- Added check for wrong derivative implementation that is reported by Dymola 2021x (https://github.com/lbl-srg/BuildingsPy/issues/376).
Expand Down
30 changes: 17 additions & 13 deletions buildingspy/development/regressiontest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1166,31 +1166,35 @@ def _add_experiment_specifications(self):
for key in con_dat.keys():
# Have dictionary in dictionary
if key == self._modelica_tool:
for s in con_dat[self._modelica_tool]:
val = con_dat[self._modelica_tool][s]
if s == 'translate':
all_dat[self._modelica_tool][s] = val
for key in con_dat[self._modelica_tool]:
val = con_dat[self._modelica_tool][key]
if key == 'translate':
all_dat[self._modelica_tool][key] = val
# Write a warning if a model is not translated
if not val:
self._reporter.writeOutput(
"{}: Requested to be excluded from translation.".format(
all_dat['model_name']))
# Set simulate to false as well as it can't be simulated
# if not translated
all_dat[self._modelica_tool]['simulate'] = False
elif s == 'simulate':
all_dat[self._modelica_tool][s] = val
elif key == 'simulate':
all_dat[self._modelica_tool][key] = val
# Write a warning if a model is not simulated
if not val:
self._reporter.writeOutput(
"{}: Requested to be excluded from simulation.".format(
all_dat['model_name']))
# Reset plot variables
all_dat['ResultVariables'] = []
else:
all_dat[self._modelica_tool][s] = val
all_dat[self._modelica_tool][key] = val
else:
all_dat[key] = con_dat[key]
# Write warning if this model should not be translated or simulated.
msg = None
if all_dat[self._modelica_tool]['translate'] is False:
msg = f"{all_dat['model_name']}: Requested to be excluded from translation."
elif all_dat[self._modelica_tool]['simulate'] is False:
msg = f"{all_dat['model_name']}: Requested to be excluded from simulation."
if msg is not None:
if 'comment' in all_dat[self._modelica_tool]:
msg = f"{msg} {all_dat[self._modelica_tool]['comment']}"
self._reporter.writeOutput(msg)

def _checkDataDictionary(self):
""" Check if the data used to run the regression tests do not have duplicate ``*.fmu`` files
Expand Down

0 comments on commit 797f8cd

Please sign in to comment.