Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix simulation id validation #138

Merged
merged 6 commits into from
Jul 4, 2024
Merged

Conversation

rengelke
Copy link
Member

Fixes #127 where validation did not consider that piParams can have multiple levels

Copy link

@dlefaudeux dlefaudeux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should also add more tests, for piParameters and OutputMappings with sim ids not in the given simulationIds


# Validate that simulationId is idnetical with piParamIds and outputMappingIds
if (!identical(simulationIds, piParamIds) || !identical(simulationIds, outputMappingIds)) {
stop(messages$errorSimulationIdMissing(id))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The id is not defined here anymore

piParamIds <- sort(piParamIds)
outputMappingIds <- sort(outputMappingIds)

# Validate that simulationId is idnetical with piParamIds and outputMappingIds

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Validate that simulationId is idnetical with piParamIds and outputMappingIds
# Validate that simulationId is identical with piParamIds and outputMappingIds

@dlefaudeux
Copy link

Also fixes #137

@rengelke rengelke requested a review from dlefaudeux July 4, 2024 08:17
Copy link

@dlefaudeux dlefaudeux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added test should be good enough.

@rengelke rengelke requested a review from Felixmil July 4, 2024 11:26
@rengelke rengelke merged commit 6d200d0 into main Jul 4, 2024
4 of 6 checks passed
@rengelke rengelke deleted the fix-simulation-id-verification branch July 4, 2024 14:51
outputMappingIds <- sort(outputMappingIds)

# Validate that simulationId is identical with piParamIds and outputMappingIds
if (!identical(simulationIds, piParamIds) || !identical(simulationIds, outputMappingIds)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When could this happen? How could the user invoke this behavior? @rengelke

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user forget data or parameters or simulations in the ParameterIdentification$new(), for example.
cf added tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants