Skip to content

Change branch condition in setStartValues - #1634

Open
AxelMatstoms wants to merge 1 commit into
OpenModelica:masterfrom
AxelMatstoms:handle-empty-ssm
Open

Change branch condition in setStartValues#1634
AxelMatstoms wants to merge 1 commit into
OpenModelica:masterfrom
AxelMatstoms:handle-empty-ssm

Conversation

@AxelMatstoms

Copy link
Copy Markdown
Contributor

Related Issues

#1628

Purpose

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.

Approach

Using ssm is not None instead ensures compliance to the SSP standard, by using the SSM branch even if there are no mappings. The effect is that no values are applied if an SSV is referenced through an "empty" SSM, which is what the standard implies.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant