Skip to content

Implicity convert function into FunctionWrappersWrapper#54

Open
densmojd wants to merge 4 commits into
SciML:mainfrom
densmojd:convert
Open

Implicity convert function into FunctionWrappersWrapper#54
densmojd wants to merge 4 commits into
SciML:mainfrom
densmojd:convert

Conversation

@densmojd

@densmojd densmojd commented Jun 6, 2026

Copy link
Copy Markdown

This PR adds the ability to implicitly convert a function into a FunctionWrappersWrapper. Specific modifications include:

  • A FunctionWrappersWrapper outer constructor for when the type parameters are specified and only the function to be wrapped is provided as an argument, i.e., FunctionWrappersWrapper{FW, P, CS}(f). Contrast this function with the existing outer constructor, where all parameters are provided as arguments.
  • Specializations of Base.convert for FunctionWrappersWrapper that use the above constructor.

These changes allow composite types with FunctionWrappersWrapper fields to be constructed by providing the functions to be wrapped only. For example, one can construct a Vector{FWW} using:

FWW[sin, cos, log]

for some concrete FWW <: FunctionWrappersWrapper.

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

Closes #52

densmojd added 4 commits June 6, 2026 11:15
…ameters are specified but only the function to be wrapped is provied as an argument.
…ng exp and cos of integer really doesn't make sense. Actually check the value of the wrapped cos.
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.

Define convert for FunctionWrappersWrapper

1 participant