-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
drop tests for indexing problem with a parameter #387
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c4e3bee
drop tests for indexing problem with a parameter
isaacsas d99890d
Update jprob_symbol_indexing.jl
ChrisRackauckas a80abc6
Update test/jprob_symbol_indexing.jl
ChrisRackauckas bd48982
bumps for the new LTS
ChrisRackauckas 77995f7
Update test/jprob_symbol_indexing.jl
ChrisRackauckas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,16 @@ affect1!(integ) = (integ.u[1] += 1) | |
affect2!(integ) = (integ.u[2] += 1) | ||
crj1 = ConstantRateJump(rate1, affect1!) | ||
crj2 = ConstantRateJump(rate2, affect2!) | ||
g = DiscreteFunction((du, u, p, t) -> nothing; syms = [:a, :b], paramsyms = [:p1, :p2]) | ||
g = DiscreteFunction((du, u, p, t) -> nothing; sys = SymbolicIndexingInterface.SymbolCache([:a, :b], [:p1, :p2], :t)) | ||
dprob = DiscreteProblem(g, [0, 10], (0.0, 10.0), [1.0, 2.0]) | ||
jprob = JumpProblem(dprob, Direct(), crj1, crj2) | ||
|
||
# runs the tests | ||
@test jprob[:a] == 0 | ||
@test jprob[:b] == 10 | ||
@test jprob[:p1] == 1.0 | ||
@test jprob[:p2] == 2.0 | ||
|
||
# tests for setindex (e.g. `jprob[:a] = 10`) not possible, this requires the problem to have a .f.sys filed., | ||
# these are no longer supported by SciMLBase | ||
@test getp(jprob,:p1)(jprob) == 1.0 | ||
@test getp(jprob,:p2)(jprob) == 2.0 | ||
ChrisRackauckas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@test jprob.ps[:p1] == 1.0 | ||
@test jprob.ps[:p2] == 2.0 | ||
Comment on lines
+18
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where has the dispatch been added to ensure |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setp
will still allow for issues, along with manual mutation.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need a custom dispatch on it then to update MassActionJumps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, @AayushSabharwal can probably help with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be great, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now have
set_parameter!
in SII which is used bysetp
internally, and can be implemented to do other bookkeeping actions whensetp
is used.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AayushSabharwal, can you add the needed dispatches to that when parameters get modified, i.e. something like what we had before when modifying a problem:
Alternatively, @ChrisRackauckas do we want to put this on users (since this could be expensive, so a faster workflow is to only call it once all parameter modifications are finished)? That does leave a gotcha someone could encounter unless they carefully read the docs (which is why the previous behavior here always updated directly after modifying a parameter).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we do put calling the jump update function on users currently when modifying integrators within callbacks, so perhaps it isn't unreasonable to do that.