Skip to content

Commit 7d36ed2

Browse files
authored
Compare with the rectangle tube by default (#433)
The omc nightly of 2026-11-18 has the tube argument of diffSimulationResults and the fixes of the csv-compare tubes at the reference points (OpenModelica/OpenModelica#18128) and at the start and stop time (OpenModelica/OpenModelica#18152). Verify with that nightly, and use the rectangle tube when a library sets no reference_tube. ModelicaTest 4.0.0 uses Modelica 4.0.0, but loadModel takes the newest compatible version, Modelica 4.1.0. The reference files are from MSL 4.0.0. Require the exact version, as the Modelica 4.0.0 entry does. Assisted-by: Claude Opus 5.5
1 parent ed6cc90 commit 7d36ed2

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎.CI/Jenkinsfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ pipeline {
4040
choice(name: 'pull_request_solver', choices: ['default', 'gbode', 'cvode', 'ida'], description: 'The solver a pull request is simulated with: default is the one each model asks for, the others are the configs/solvers.json entries of that name. With the C target, the baseline is then that solver\'s table, which the solvers job fills; nothing fills one for wasm-jit, so set pull_request_baseline yourself or compare against the default solver.')
4141
string(name: 'pull_request_simflags', defaultValue: '', description: 'Simulation flags appended to every model\'s, after those of pull_request_solver, e.g. -gbm=esdirk3 to run gbode with another method.')
4242
string(name: 'pull_request_baseline', defaultValue: '', description: 'The branch a pull request is compared against. Left empty, the one pull_request_target is tested by: wasm-jit for wasm-jit, master for C, or for C with a pull_request_solver its own table. Its newest run has to come from pull_request_node, or the report compares the machines as much as the pull request.')
43-
choice(name: 'pull_request_verifier', choices: ['nightly', 'pull request'], description: 'The omc that test.py and testmodel.py run through OMPython, which lists the models and compares the results with the reference files (diffSimulationResults): the nightly of the testing image, as for every other run, or the omc built from the pull request, to test a change of the comparison itself. A reference_tube in the configuration needs an omc that has the tube argument.')
44-
choice(name: 'pull_request_tube', choices: ['default', 'rectangle', 'ellipse', 'ellipse2014'], description: 'The tube diffSimulationResults compares a pull request\'s results with: default is the reference_tube of each library, the others override it. Anything but default needs pull_request_verifier set to pull request until the nightly has the tube argument.')
43+
choice(name: 'pull_request_verifier', choices: ['nightly', 'pull request'], description: 'The omc that test.py and testmodel.py run through OMPython, which lists the models and compares the results with the reference files (diffSimulationResults): the nightly of the testing image, as for every other run, or the omc built from the pull request, to test a change of the comparison itself.')
44+
choice(name: 'pull_request_tube', choices: ['default', 'rectangle', 'ellipse', 'ellipse2014'], description: 'The tube diffSimulationResults compares a pull request\'s results with: default is the reference_tube of each library, the others override it.')
4545
string(name: 'pull_request_config', defaultValue: 'configs/conf.json', description: 'What a pull request run tests. A full run takes days, so a smaller configuration file is often the better question to ask.')
4646
choice(name: 'pull_request_node', choices: ['ryzen-9950x', 'ryzen-5950x-1', 'ryzen-5950x-2-1', 'r7945-1'], description: 'The machine a pull request runs on. The default is the one that produces the master and wasm-jit runs it is compared against.')
4747
booleanParam(name: 'pull_request_comment', defaultValue: false, description: 'Post the summary of a pull request run as a comment on the pull request, replacing the one an earlier run posted. Needs an OpenModelica-Hudson credential; without it the report is still written and published, only not commented.')

‎.CI/testing/Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ ENV PATH=/opt/libtest-venv/bin:$PATH
5454

5555
# The omc for --ompython_omhome (the tested one is built in the workspace).
5656
ARG OMC_VERSION=
57-
ARG OMC_NIGHTLY=2026-11-11
57+
ARG OMC_NIGHTLY=2026-11-18
5858
RUN export DEBIAN_FRONTEND=noninteractive \
5959
&& echo "omc nightly ${OMC_NIGHTLY}" \
6060
&& . /etc/os-release \

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ different OpenModelica versions, according to the conditions of the
122122
"git-ref": "main",
123123
"git-directory": "ReferenceFiles"
124124
},
125-
"reference_tube": "rectangle", // diffSimulationResults(tube=OpenModelica.Scripting.TubeAlgorithm.<this>): rectangle, ellipse or ellipse2014 (when left out); needs an omc that has the tube argument
125+
"reference_tube": "rectangle", // diffSimulationResults(tube=OpenModelica.Scripting.TubeAlgorithm.<this>): rectangle (when left out), ellipse or ellipse2014
126126
"reference_tolerance": 0.002, // rangeDelta of the rectangle and ellipse tubes (csv-compare's --tolerance); when left out, the default of diffSimulationResults, which is csv-compare's; ellipse2014 uses reference_rangeDelta
127127
"defaultTolerance": 1e-6, // tolerance for tests if not specified by the model, defaults to 1e-6
128128
"defaultNumberOfIntervals": 2500, // number of intervals for tests if not specified by the model, defaults to 2500

‎configs/conf.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
{
7171
"library":"ModelicaTest",
7272
"libraryVersion":"4.0.0",
73+
"libraryVersionExactMatch":true,
7374
"referenceFileExtension":"csv",
7475
"referenceFileNameDelimiter":"/",
7576
"referenceFileNameExtraName":"$ClassName",

‎shared.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,13 @@ def simCodeTargetFromCommands(target, commands):
3737
def diffSimulationResultsOptions(conf):
3838
"""The named arguments of the diffSimulationResults call that verifies a result."""
3939
opts = [("relTol", conf["reference_reltol"]), ("relTolDiffMinMax", conf["reference_reltolDiffMinMax"])]
40-
tube = conf.get("reference_tube")
40+
tube = conf["reference_tube"]
4141
# Without reference_tolerance, the csv-compare tubes get the default of diffSimulationResults, which is csv-compare's.
4242
if tube not in ("rectangle", "ellipse"):
4343
opts.append(("rangeDelta", conf["reference_rangeDelta"]))
4444
elif "reference_tolerance" in conf:
4545
opts.append(("rangeDelta", conf["reference_tolerance"]))
46-
# Only passed when set: an omc without the tube argument fails the call.
47-
if tube:
48-
opts.append(("tube", tube))
46+
opts.append(("tube", tube))
4947
return opts
5048

5149
def fixData(data,abortSimulationFlag,alarmFlag,overrideDefaults,defaultCustomCommands,extrasimflags,environmentTranslation,environmentSimulation):
@@ -63,6 +61,7 @@ def fixData(data,abortSimulationFlag,alarmFlag,overrideDefaults,defaultCustomCom
6361
data["reference_reltol"] = float(data.get("reference_reltol") or 3e-3)
6462
data["reference_reltolDiffMinMax"] = float(data.get("reference_reltolDiffMinMax") or 3e-3)
6563
data["reference_rangeDelta"] = float(data.get("reference_rangeDelta") or 1e-3)
64+
data["reference_tube"] = data.get("reference_tube") or "rectangle"
6665
if data["simCodeTarget"]=="Cpp":
6766
defaultCustomCommands2 = defaultCustomCommands[:]
6867
defaultCustomCommands2.append('setCommandLineOptions("--simCodeTarget=Cpp")')

0 commit comments

Comments
 (0)