Skip to content

Support auxiliary data #32

@quattro

Description

@quattro

Hi! Awesome library.

I realize this may be a tall order, but it would be fantastic to allow for auxiliary data to be returned from user specified functions. This can useful for updating intermediate state objects. A good example is in optimistix.

I suppose it would also require users to specify some mapping function on how to combine two pytrees such that the end result would be value, aux = quadgk(func, interval, has_aux=True, tree_map_func=my_map_func) where value is the final integral and aux is the mapped (e.g., averaged, summed) auxiliary pytree.

I think one workaround now is that if aux is another array, I could concatenate them together and parse out afterwards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions