Skip to content

Less restrictive promote_u0_p #3624

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

Merged
merged 1 commit into from
May 12, 2025
Merged

Less restrictive promote_u0_p #3624

merged 1 commit into from
May 12, 2025

Conversation

devmotion
Copy link
Member

#3572 broke our downstream code that uses p::Functions (to be evaluated at integration time t) as parameters.

Given that none of the other involved functions restricts p explicitly to a Union{AbstractArray,MTKParameters}, IMO it seems natural to use DiffEqBase.promote_u0 as a generic fallback and not only in the case p::AbstractArray.

@ChrisRackauckas
Copy link
Member

Wouldn't p::Function go down the MTKParameters path with the splitting? Do you have an MWE we can test against here?

@devmotion
Copy link
Member Author

The system itself is not constructed with ::Function parameters. The use case is a bit special, remake is called on an ODEProblem with an MTK system but f is explicitly set to a custom wrapper of the original ODE function that unpacks ::Function parameters and p is explicitly set to such a ::Function parameter.

@devmotion
Copy link
Member Author

remake ends up in MTK since an MTK system is involved.

@ChrisRackauckas
Copy link
Member

Oh is this the Chris E hack in Pumas for lifting the covariate constructions? I really don't like how that interacts with the interface... though we might as well keep it alive. Definitely not something to document telling people to do it 😅

@ChrisRackauckas ChrisRackauckas merged commit 8513736 into master May 12, 2025
50 of 90 checks passed
@ChrisRackauckas ChrisRackauckas deleted the dw/promote_u0_p branch May 12, 2025 16:14
@devmotion
Copy link
Member Author

Could we tag a new release of MTK?

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.

2 participants