Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78d0184a71
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if kwargs.get("kind", self.kwargs.get("kind")) != self.kwargs.get("kind"): | ||
| self.kwargs = {} |
There was a problem hiding this comment.
Preserve staged kwargs when assigning the initial kind
When callers stage a method's options before selecting it—for example, d = SINDyDerivative(k=2); d.set_params(kwargs={"kind": "finite_difference"})—self.kwargs has no current kind, so this condition is true and the reset silently discards k; differentiation then uses a default value, or methods with required options fail. The constructor permits an unset kind and set_params previously supported incremental kwargs, so the reset should apply only when an existing, different kind is being replaced.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Initial kind assignment now retains staged options; old parameters are cleared only when an existing kind changes. Added four regression cases covering finite differences, Savitzky–Golay, splines and trend filtering. The two relevant test files pass all 133 tests, and the applicable pre-commit checks pass.
Fixes #546, reported by @djpasseyjr.
SINDyDerivative.set_params(kwargs=...)merges the requested dictionary into the previous method's configuration. Switching from Savitzky–Golay to trend filtering therefore passes obsoleteleft/rightarguments toLassoand raisesTypeError. Other method switches leave stale parameters inget_params().Clear the previous method's arguments when
kindchanges, then apply the requested parameters. Keep incremental updates for the same method, including partial and empty dictionaries and replacing the differentiation method before setting its parameters. Add four method-switch regressions, a nestedSINDy.set_params/fitregression and three compatibility controls for the existing nestedkwargsinterface introduced in #207.Validation on Windows, Python 3.12.14, NumPy 2.5.4, scikit-learn 1.9.1 and derivative 0.6.3:
test/test_differentiation.py test/test_pysindy.py) with identical added tests: baseline 5 failed/124 passed; fixed 129 passed. Existing cross-validation scoring warnings remain; this change does not repair that separate scoring issue.The full repository suite, documentation build, other platforms and performance were not tested.