From 8f03078fe5ef7ca190b341c23ae43154dc91c226 Mon Sep 17 00:00:00 2001 From: Axel Matstoms Date: Tue, 25 Aug 2026 14:20:13 +0200 Subject: [PATCH] Change branch condition in setStartValues The SSP standard allows empty SSM files. When an SSM is present, no values except those in the SSM should be applied. This behavior corresponds to the first branch in setStartValues. Previously the condition in this if statement was `ssm and ssm.mappingEntry`. This means empty SSM files caused the other branch to be selected. This is contrary to what the standard requires. Using `ssm is not None` instead ensures compliance to the SSP standard. --- src/OMSimulatorPython/instantiated_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OMSimulatorPython/instantiated_model.py b/src/OMSimulatorPython/instantiated_model.py index 1a9c1d4bb..372048c2a 100644 --- a/src/OMSimulatorPython/instantiated_model.py +++ b/src/OMSimulatorPython/instantiated_model.py @@ -351,7 +351,7 @@ def setStartValues(self, value: Values, systemName: str, ssm: SSM | None): raise KeyError(f"Missing required key: '{systemName}'") ## apply ssm mapping if exist and apply start values from mapped parameters - if ssm and ssm.mappingEntry: + if ssm is not None: for source, targets in ssm.mappingEntry.items(): if CRef(source) in value.start_values: (source_value, type, _, _) = value.start_values[CRef(source)]