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

Reference point when resolving relative object paths in event assignments #2198

Open
Yuri05 opened this issue Jan 17, 2024 · 3 comments
Open
Assignees
Labels
RFC Request For Comments

Comments

@Yuri05
Copy link
Member

Yuri05 commented Jan 17, 2024

At the moment, when the object references in event assignments formulas are resolved, the reference assignment itself is used as the reference point (and not the assigned entity).
I think this is wrong and should be changed.

E.g. check this example and try to create a simulation: Event_Assignment_Path_Resolution.zip

In my spatial structure, I have 2 containers under Organism : Organ1 and Organ2.
Both containers have parameters P1 and P2.
grafik grafik

I define a new event, which should set P1 := P2 in both organs (with P2 from the same organ as P1).
So I define a formula P2 with P2 referenced as ..|P2 and use this formula in both event assignments:

Now when trying to create a simulation, I get 2 errors below (1 error per event assignment), which show that the object reference "..|P2" is being resolved relative to the event assignment and not relative to Organism|OrganX|P1
grafik

So now I would need to define 2 different formulas - one for each event assignment, where I reference the parameter P1 e.g. with its absolute path (Organism|Organ1|P1 for the 1st assignment and Organism|Organ2|P1 for the 2nd).

This is very inconvenient and should be changed (e.g. with the status quo we cannot avoid formulas duplication described in Open-Systems-Pharmacology/PK-Sim#2856)

@PavelBal
Copy link
Member

Is it a use case for a new keyword? :D

I think the current behavior (assignment is the local reference point) follows the logic of the relative path concept within the suite. Changing this behavior would also break many things, I guess. For example, adding the amount of water of an oral application to the total liquid volume in stomach is given by the formula:

Liquid + Water with Water = ..|..|ProtocolSchemaItem|Amount of water the amount of water in the particular administration. This would not work any more if the local reference point were the changed entity Organism|Lumen|Stomach|Liquid.

I see how the solution you proposed can make certain things easier. So maybe we should indeed introduce a new keyword, like ENTITY or CHANGED_ENTITY?

@PavelBal
Copy link
Member

PavelBal commented Jan 17, 2024

So definitely not a bug for me.

@Yuri05
Copy link
Member Author

Yuri05 commented Jan 17, 2024

Is it a use case for a new keyword? :D

I think the current behavior (assignment is the local reference point) follows the logic of the relative path concept within the suite. Changing this behavior would also break many things, I guess. For example, adding the amount of water of an oral application to the total liquid volume in stomach is given by the formula:

Liquid + Water with Water = ..|..|ProtocolSchemaItem|Amount of water the amount of water in the particular administration. This would not work any more if the local reference point were the changed entity Organism|Lumen|Stomach|Liquid.

I see how the solution you proposed can make certain things easier. So maybe we should indeed introduce a new keyword, like ENTITY or CHANGED_ENTITY?

yeah, you are right, these are 2 different use cases and the current use case would not work anymore.
Maybe a new keyword indeed.. need to think more about it.

@Yuri05 Yuri05 added RFC Request For Comments and removed type: bug labels Jan 17, 2024
@Yuri05 Yuri05 changed the title Wrong reference point when resolving relative object paths in event assignments Reference point when resolving relative object paths in event assignments Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC Request For Comments
Projects
None yet
Development

No branches or pull requests

4 participants