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

Formulas are resolved before applying PV - unwanted behavior #2297

Closed
PavelBal opened this issue Aug 7, 2024 · 7 comments · Fixed by #2298
Closed

Formulas are resolved before applying PV - unwanted behavior #2297

PavelBal opened this issue Aug 7, 2024 · 7 comments · Fixed by #2298
Assignees
Milestone

Comments

@PavelBal
Copy link
Member

PavelBal commented Aug 7, 2024

formula-resolved-before-pb.zip

In the attached project, the module Test2 defines a parameter Organism|Param by an invalid formula (the referenced parameter foo is not present).

image

Additionally, the value of the parameter is defined in the PV BB

image

When trying to create a simulation, an error is thrown that foo is not found. This behavior is unwanted, as I want the value defined in the PV BB to be applied without the formula being evaluated. This is how it worked in MoBi 11, and it was a way to overwrite parameters that otherwise would not be resolved.

@PavelBal PavelBal added this to the Version 12 milestone Aug 7, 2024
@msevestre
Copy link
Member

this worked before?

@PavelBal
Copy link
Member Author

PavelBal commented Aug 7, 2024

Yes, V11.

@msevestre msevestre self-assigned this Aug 8, 2024
@msevestre
Copy link
Member

ok moving to core

@msevestre msevestre transferred this issue from Open-Systems-Pharmacology/MoBi Aug 8, 2024
@msevestre
Copy link
Member

@PavelBal I don't think this worked before. PSV were applied after validation . But anyways

@msevestre
Copy link
Member

hum nevermind. It's validating the configuration and not the updated model

@msevestre
Copy link
Member

ok so this is because of this code here

  var actualParameterValue = parameterValue.Value.Value;
  if (parameter.Formula is ConstantFormula constantFormula)
     constantFormula.Value = actualParameterValue;
  else
     parameter.Value = actualParameterValue;

We say that if the formula is constant, we overwrite the constant value with the value
Otherwise we simply let the formula and let the isFixedValue= true in the simulation

@Yuri05 and @PavelBal
I tired to skp validation if the value is overwritten. But this does not work because then we try to resolve references later on
So we need to OVERWRITTE WRONG FORMULAS with constant somehow. That means that we need to evaluate them all again.... doable but a bit of a pain

msevestre added a commit that referenced this issue Aug 8, 2024
@msevestre msevestre mentioned this issue Aug 8, 2024
16 tasks
@PavelBal
Copy link
Member Author

PavelBal commented Aug 8, 2024

I don't think this worked before. PSV were applied after validation . But anyways

This definitely worked, I relied on this concept a lot in my projects and now I cannot create the simulations because of this changed behavior :)

@github-project-automation github-project-automation bot moved this to Fixed in v12 Aug 9, 2024
@Yuri05 Yuri05 moved this from Fixed to Verified in v12 Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Verified
Development

Successfully merging a pull request may close this issue.

2 participants