Skip to content

Commit c4cfa61

Browse files
authored
Added check for integer being too large in Optimica CI tests (#553)
This catches the Optimica warnings of the form 'Integer literal "7347600000" is too large to represent as 32-bit'
1 parent 76d8465 commit c4cfa61

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

buildingspy/CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ BuildingsPy Changelog
44
Version 5.2.0, xxxx
55
^^^^^^^^^^^^^^^^^^^
66

7+
- For Optimica regression tests, added check for Integers that are too large to be represented
78
- In buildingspy/development/refactor.py, corrected moving images to avoid creating
89
a directory if the target directory already exists.
910
(https://github.com/lbl-srg/BuildingsPy/pull/548)

buildingspy/development/error_dictionary_optimica.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,11 @@ def __init__(self):
3535
self._error_dict["errorneous each"] = {
3636
'tool_message': "Ignoring erroneous 'each' for the modification",
3737
'counter': 0,
38-
# 'buildingspy_var': "iEacIgn",
39-
# 'model_message': "Keyword 'each' applied to scalar in '{}'.",
4038
'summary_message': "Number of models with erroneous 'each' : {}\n"}
4139

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

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

6559
# Search for strings such as
@@ -75,6 +69,12 @@ def __init__(self):
7569
self._error_dict["connector to itself"] = {
7670
'tool_message': "connection from connector to itself",
7771
'counter': 0,
78-
# 'buildingspy_var': "iIteMis",
79-
# 'model_message': "Keyword 'each' applied to scalar in '{}'.",
8072
'summary_message': "Number of models with connectors that connect to itself : {}\n"}
73+
74+
# Check for too large integers, which causes warnings of the form
75+
# Integer literal "7347600000" is too large to represent as 32-bit
76+
# Integer, using Real instead.
77+
self._error_dict["too large Integer"] = {
78+
'tool_message': "Integer, using Real instead",
79+
'counter': 0,
80+
'summary_message': "Number of models with too large Integers : {}\n"}

0 commit comments

Comments
 (0)