-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
refactor: change SCCNonlinearProblem
fields
#884
Merged
Merged
Changes from all commits
Commits
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -526,8 +526,7 @@ function remake(prob::SCCNonlinearProblem; u0 = missing, p = missing, probs = mi | |
if p !== missing && !parameters_alias && probs === missing | ||
throw(ArgumentError("`parameters_alias` is `false` for the given `SCCNonlinearProblem`. Please provide the subproblems using the keyword `probs` with the parameters updated appropriately in each.")) | ||
end | ||
newu0, newp = updated_u0_p(prob, u0, p; interpret_symbolicmap, use_defaults, | ||
indp = sys === missing ? prob.full_index_provider : sys) | ||
newu0, newp = updated_u0_p(prob, u0, p; interpret_symbolicmap, use_defaults) | ||
if probs === missing | ||
probs = prob.probs | ||
end | ||
|
@@ -547,11 +546,10 @@ function remake(prob::SCCNonlinearProblem; u0 = missing, p = missing, probs = mi | |
end | ||
end | ||
if sys === missing | ||
sys = prob.full_index_provider | ||
sys = prob.f.sys | ||
end | ||
return SCCNonlinearProblem{ | ||
typeof(probs), typeof(explicitfuns!), typeof(sys), typeof(newp)}( | ||
probs, explicitfuns!, sys, newp, parameters_alias) | ||
return SCCNonlinearProblem( | ||
probs, explicitfuns!, newp, parameters_alias; sys) | ||
end | ||
|
||
function varmap_has_var(varmap, var) | ||
|
@@ -784,11 +782,11 @@ end | |
|
||
function updated_u0_p( | ||
prob, u0, p, t0 = nothing; interpret_symbolicmap = true, | ||
use_defaults = false, indp = has_sys(prob.f) ? prob.f.sys : nothing) | ||
use_defaults = false) | ||
if u0 === missing && p === missing | ||
return state_values(prob), parameter_values(prob) | ||
end | ||
if indp === nothing | ||
if prob.f.sys === nothing | ||
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. this line causes SciML/Integrals.jl#259 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. |
||
if interpret_symbolicmap && eltype(p) !== Union{} && eltype(p) <: Pair | ||
throw(ArgumentError("This problem does not support symbolic maps with " * | ||
"`remake`, i.e. it does not have a symbolic origin. Please use `remake`" * | ||
|
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
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.
wait what is this
p
? How does it relate to the actualp
of theprobs
?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.
This
p
is the parameter object for SII. Since the parameter object is not guaranteed to be identical for all problems, the user can provide one that SII will use and thatprob.f.observed
will codegen for. There's a flag if all problems share the same parameter object, which aliasesprob.p
and functions likeset_parameter!
take advantage of this.