Skip to content

Commit

Permalink
Added check for integer being too large in Optimica CI tests (lbl-srg…
Browse files Browse the repository at this point in the history
…#553)

This catches the Optimica warnings of the form 'Integer literal "7347600000" is too large to represent as 32-bit'
  • Loading branch information
mwetter authored May 8, 2024
1 parent 76d8465 commit c4cfa61
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions buildingspy/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ BuildingsPy Changelog
Version 5.2.0, xxxx
^^^^^^^^^^^^^^^^^^^

- For Optimica regression tests, added check for Integers that are too large to be represented
- In buildingspy/development/refactor.py, corrected moving images to avoid creating
a directory if the target directory already exists.
(https://github.com/lbl-srg/BuildingsPy/pull/548)
Expand Down
16 changes: 8 additions & 8 deletions buildingspy/development/error_dictionary_optimica.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,11 @@ def __init__(self):
self._error_dict["errorneous each"] = {
'tool_message': "Ignoring erroneous 'each' for the modification",
'counter': 0,
# 'buildingspy_var': "iEacIgn",
# 'model_message': "Keyword 'each' applied to scalar in '{}'.",
'summary_message': "Number of models with erroneous 'each' : {}\n"}

self._error_dict["assuming each"] = {
'tool_message': "Assuming 'each' for the modification",
'counter': 0,
# 'buildingspy_var': "iEacAss",
# 'model_message': "Keyword 'each' applied to scalar in '{}'.",
'summary_message': "Number of models with assuming 'each' : {}\n"}

# Search for strings such as Iteration variable "chi_y.QCon_flow" is missing start value!
Expand All @@ -58,8 +54,6 @@ def __init__(self):
self._error_dict["redeclare of non-replaceable"] = {
'tool_message': "can't be redeclared since it has already been redeclared without 'replaceable'",
'counter': 0,
# 'buildingspy_var': "iIteMis",
# 'model_message': "Keyword 'each' applied to scalar in '{}'.",
'summary_message': "Number of models with redeclare of no longer replaceable class : {}\n"}

# Search for strings such as
Expand All @@ -75,6 +69,12 @@ def __init__(self):
self._error_dict["connector to itself"] = {
'tool_message': "connection from connector to itself",
'counter': 0,
# 'buildingspy_var': "iIteMis",
# 'model_message': "Keyword 'each' applied to scalar in '{}'.",
'summary_message': "Number of models with connectors that connect to itself : {}\n"}

# Check for too large integers, which causes warnings of the form
# Integer literal "7347600000" is too large to represent as 32-bit
# Integer, using Real instead.
self._error_dict["too large Integer"] = {
'tool_message': "Integer, using Real instead",
'counter': 0,
'summary_message': "Number of models with too large Integers : {}\n"}

0 comments on commit c4cfa61

Please sign in to comment.