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

Generalize integrand f to any callable #132

Open
mikeingold opened this issue Nov 13, 2024 · 2 comments
Open

Generalize integrand f to any callable #132

mikeingold opened this issue Nov 13, 2024 · 2 comments
Labels
breaking enhancement New feature or request

Comments

@mikeingold
Copy link
Collaborator

For some integral(f, geometry...), our API currently requires f::Function. However, the only real requirement for f internally is that it must expose a method f(::Point), which can be fulfilled by other callables. For example:

struct Widget
    ...
end

(w::Widget)(p::Point) = ...

w = Widget(...)
geometry = ...

integral(w, geometry)

Enabling this would require

  • a sweep of all integral and _integral methods to remove type params from f
  • updating documentation, e.g. mentioning this fact in the README
  • evaluating whether this causes any dispatch issues
  • adding a test that specifies a callable non-Function for f
@JoshuaLampert
Copy link
Member

Why is this breaking?

@mikeingold
Copy link
Collaborator Author

Why is this breaking?

I don’t think it’s strictly breaking, but I added the label as a marker to remember that I’d like to complete this one prior to this upcoming breaking v0.16 release.

@mikeingold mikeingold pinned this issue Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants