-
Notifications
You must be signed in to change notification settings - Fork 303
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
Differentiation of Multidimensional Arrays in SINDyDerivative #476
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -418,3 +418,12 @@ def test_centered_difference_noaxis_vs_axis(data_2d_resolved_pde): | |
slow_differences_t, | ||
atol=atol, | ||
) | ||
|
||
|
||
def test_multidimensional_differentiation(): | ||
X = np.random.random(size=(10, 100, 2)) | ||
t = np.arange(0, 10, 0.1) | ||
|
||
X_dot = SINDyDerivative(kind="kalman", axis=-2)._differentiate(X, t) | ||
|
||
assert X_dot.shape == X.shape | ||
Comment on lines
+423
to
+429
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's make sure we differentiate the correct axis, rather than just verifying that it runs without error. E.g.:
Change the name to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's also worth checking whether this preserves |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we assign attributes before we've calculated them? I think it makes more sense to calculate them, then assign