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

use SII.finalize_parameters_hook! when updating problems #409

Merged
merged 6 commits into from
Mar 26, 2024

Conversation

isaacsas
Copy link
Member

Finishes #408

@isaacsas isaacsas changed the title WIP: use SII.finalize_parameters_hook when updating problems WIP: use SII.finalize_parameters_hook! when updating problems Mar 25, 2024
src/problem.jl Outdated
function SII.set_parameter!(prob::JumpProblem, val, idx)
ans = SII.set_parameter!(SII.parameter_values(prob), val, idx)

function SII.finalize_parameters_hook!(prob::JumpProblem, p)
if using_params(prob.massaction_jump)
update_parameters!(prob.massaction_jump, prob.prob.p)
Copy link
Member Author

Choose a reason for hiding this comment

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

@AayushSabharwal is using prob.prob.p correct here? The argument p is just the newly changed parameters right? (And prob.prob.p should already be updated when this is called?)

Copy link
Member

Choose a reason for hiding this comment

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

Yes. p is the parameter symbol(s) updated by setp. For the parameter values you'd need parameter_values(prob) (or prob.prob.p in this case). If I'm being picky I'd suggest using parameter_values(prob) or parameter_values(prob.prob) at least

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, I switched to parameter_values(prob).

@coveralls
Copy link

coveralls commented Mar 25, 2024

Pull Request Test Coverage Report for Build 8440125933

Details

  • 2 of 3 (66.67%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.005%) to 86.015%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/problem.jl 2 3 66.67%
Totals Coverage Status
Change from base Build 8422543521: -0.005%
Covered Lines: 2208
Relevant Lines: 2567

💛 - Coveralls

@isaacsas isaacsas changed the title WIP: use SII.finalize_parameters_hook! when updating problems use SII.finalize_parameters_hook! when updating problems Mar 26, 2024
@isaacsas
Copy link
Member Author

If tests pass I'll plan to merge and make a new release.

@ChrisRackauckas
Copy link
Member

Awesome, good to see this is finally done.

So then, Catalyst is close?

Sorry for all of the chaos but I think we're getting to stable again.

@isaacsas
Copy link
Member Author

We're getting there! On the jump side all that is left after this is updating the parameter mapper for JumpSystems in MTK to work with SII correctly (i.e. the stuff that handles recalculating mass action rates when parameters change from the symbolic rate constant expressions). I'll then add some more comprehensive tests in MTK to go with that and make sure symbolic indexing works in the various desired ways with jump systems.

I think aside from that @TorkelE has successfully run most Catalyst stuff now with the merged and open PRs we are finalizing. He has really put in a heroic effort updating stuff and patiently addressing my many comments, including a pretty through update of our tests. We are tracking what needs to be done for a MTK9 compatible release in SciML/Catalyst.jl#775 -- we have a bunch of other changes that will go in via other open PRs, but should hopefully get a release in the not too distant future (like getting 1:1 equivalence between the DSL and symbolic interface finally).

@isaacsas isaacsas mentioned this pull request Mar 26, 2024
@isaacsas isaacsas merged commit e640a12 into SciML:master Mar 26, 2024
5 of 7 checks passed
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.

4 participants