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

feat: add new remake(::AbstractSciMLFunction), fix some remake bugs. #891

Merged
merged 13 commits into from
Dec 14, 2024

Conversation

AayushSabharwal
Copy link
Member

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Add any other context about the problem here.

@AayushSabharwal
Copy link
Member Author

Formatting issues are on master, will make a separate PR to fix them to avoid confusing the intent of this one.

Comment on lines +102 to +116
"""
$(TYPEDSIGNATURES)

A utility function which merges two `NamedTuple`s `a` and `b`, assuming that the
keys of `a` are a subset of those of `b`. Values in `b` take priority over those
in `a`, except if they are `nothing`. Keys not present in `a` are assumed to have
a value of `nothing`.
"""
function _similar_namedtuple_merge_ignore_nothing(a::NamedTuple, b::NamedTuple)
ks = fieldnames(typeof(b))
return NamedTuple{ks}(ntuple(Val(length(ks))) do i
something(get(b, ks[i], nothing), get(a, ks[i], nothing), Some(nothing))
end)
end

Copy link
Member

Choose a reason for hiding this comment

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

isn't this just (;a..., b...)?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, because nothing values in b will override values in a. This function makes it so that if a key has the value nothing in b, it uses the value from a.

@ChrisRackauckas ChrisRackauckas merged commit b0dc015 into SciML:master Dec 14, 2024
32 of 51 checks passed
@AayushSabharwal AayushSabharwal deleted the as/fix-mtk-tests branch December 14, 2024 05:40
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