-
Notifications
You must be signed in to change notification settings - Fork 323
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
Implicit multiple trajectories #376
Conversation
705964a
to
95e178a
Compare
So this passes in 3.10, but fails <3.10 because |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #376 +/- ##
==========================================
+ Coverage 93.70% 93.81% +0.10%
==========================================
Files 37 37
Lines 3589 3604 +15
==========================================
+ Hits 3363 3381 +18
+ Misses 226 223 -3
☔ View full report in Codecov by Sentry. |
This counts as green CI, I believe. Similar situation as before - deletion PR with 100% of diff covered, but because covered lines were deleted, overall coverage drops. |
I'm good with this change! Only request: run each of the example notebooks to verify that the edge case doesn't need to be eliminated in the notebooks. |
Thanks @znicolaou! I searched through all the notebooks, and anything that used My short fix for the notebooks (later; as we get closer to 2.0) will be to add an |
Also: annotate and add docstring to validate_control_variables add AxesArray syntax
…ries Make multiple trajectories implicit, treating a list of arrays for x, x_dot, or u as multiple trajectories. Resolves dynamicslab#353
For your consideration, here's a PR that implements #353.
tl;dr: IMO the
multiple_trajectories
argument is unneccessary and its removal simplifies calling signatures.SINDy.fit()
knows users want multiple trajectories when they pass a list of arrays - the same way many numpy functions have implicit behavior when passed a list of arrays instead of a single array. OTOH, there exists a niche case where someone callsfit()
withx
as a list instead of an array andt
as a float. Previously, this would give an error, while in this PR, it would be allowed, similar to how submitting transposed data is allowed but doesn't give people what they think. If people desire, I can add guard code around specifically this case, but my feeling is that the docstring is clear and the edge case may not exist in the wild.