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

Add Basis.derivatives #102

Merged
merged 6 commits into from
Dec 3, 2024
Merged

Add Basis.derivatives #102

merged 6 commits into from
Dec 3, 2024

Conversation

inducer
Copy link
Owner

@inducer inducer commented Dec 2, 2024

@inducer
Copy link
Owner Author

inducer commented Dec 2, 2024

This spiraled a bit more than I had anticipated, but I think overall it's a step towards making the interface more composable.

@inducer
Copy link
Owner Author

inducer commented Dec 2, 2024

It also simplifies the tensor product derivative spaghetti by quite a bit.

@inducer inducer requested a review from alexfikl December 2, 2024 19:49
@inducer inducer marked this pull request as ready for review December 2, 2024 19:49
modepy/modes.py Outdated
@@ -766,6 +791,28 @@ def gradients(self) -> tuple[BasisGradientType, ...]:
Each function returns a tuple of derivatives, one per reference axis.
"""

def functions_dr(self, axis: int) -> tuple[BasisFunctionType, ...]:
Copy link
Owner Author

Choose a reason for hiding this comment

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

Still unsure about the name. Suggestions?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Maybe just derivatives? deriv_functions?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for derivatives

Copy link
Owner Author

Choose a reason for hiding this comment

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

I agree, that's probably the sanest. Renamed to that in the latest.

Copy link
Collaborator

Choose a reason for hiding this comment

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

axis_derivative_functions?

I'm also leaning towards derivatives, so that's perfectly fine by me!

Copy link
Owner Author

Choose a reason for hiding this comment

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

axis_derivatives is another option, but it's unlikely that we'd have any other type (directional?) derivative, so 🤷. I say let's leave it as derivatives.

@inducer inducer changed the title Add functions_dr Add Basis.derivatives Dec 2, 2024
Copy link
Collaborator

@alexfikl alexfikl left a comment

Choose a reason for hiding this comment

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

Left a little documentation nitpick, but otherwise this looks good to me!

modepy/matrices.py Outdated Show resolved Hide resolved
@inducer inducer merged commit 8064696 into main Dec 3, 2024
9 checks passed
@inducer inducer deleted the functions-dr branch December 3, 2024 20:25
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.

3 participants