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

Documentation page on how to access model properties #889

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TorkelE
Copy link
Member

@TorkelE TorkelE commented May 30, 2024

Not actually sure what to call this one, but this is the tutorial that goes through how to access stuff within a ReactionSystem.

  • For a starter, it goes through basic stuff like species(rs).
  • For now, I also put our main section on how accessing symbolic variables via the model (e.g. rs.X) works.
  • There is also a bit on hierarchical models, i.e. the difference between get_species and species, and rs.submodelname.X.

!!! warn
Generally, the field of Julia structures can be accessed through `struct.field`. E.g. a simulation's time vector can be retrieved using `simulation.t`. While Catalyst `ReactionSystem`s are structures, one should *never* access their fields using this approach, but rather using the accessor functions described below and in the [API](@ref ref) (direct accessing of fields can yield unexpected behaviours). E.g. to retrieve the species of a `ReactionsSystem` `rs`, use `Catalyst.get_species(rs)`, *not* `rs.species`.

## [Direct accessing of symbolic model parameter and species](@id model_accessing_symbolic_variables)
Copy link
Member Author

Choose a reason for hiding this comment

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

I think it is good to have a dedicated section going through this, and I think this is a place where it makes sense to put it (the other alternatives would be the advanced introduction or the compositional modelling part, right now I feel this was the most fitting place).

ModelingToolkit.get_iv(sir)
```

## [Accessing properties of hierarchical models](@id model_accessing_hierarchical)
Copy link
Member Author

Choose a reason for hiding this comment

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

There is quite a lot on this, but I felt it was good to go through it properly (as I personally also have been a bit unfamiliar with it). Definitely check this part in case I have made a misstake.

@TorkelE TorkelE changed the title Documentation page on how to access model properties [Ready] Documentation page on how to access model properties Jun 5, 2024
@TorkelE TorkelE changed the title [Ready] Documentation page on how to access model properties [Documentation - Ready] Documentation page on how to access model properties Jun 5, 2024
@TorkelE TorkelE changed the title [Documentation - Ready] Documentation page on how to access model properties [Non-urgent - Ready] Documentation page on how to access model properties Jun 11, 2024
@TorkelE TorkelE changed the title [Non-urgent - Ready] Documentation page on how to access model properties Documentation page on how to access model properties Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant