fix: Three bugs in WeakSINDy/EmptyLibrary from code review#682
Closed
fix: Three bugs in WeakSINDy/EmptyLibrary from code review#682
Conversation
15 tasks
…le shadowing in _plan_weak_form Co-authored-by: Jacob-Stevens-Haas <37048747+Jacob-Stevens-Haas@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor weak form SINDy to separate SINDy class
fix: Three bugs in WeakSINDy/EmptyLibrary from code review
Feb 27, 2026
Member
|
This works well, but I changed some names and will push directly to _weak. Is there a way to change your commit behavior? I didn't like that you had a commit message title exceeding 72 characters and that you created an empty "Initial Commit" commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code review of the WeakSINDy PR uncovered three bugs.
Changes
EmptyLibrary.transformshape error (feature_library/base.py):np.empty((x.shape[:-1], 0))wraps the shape in a nested tuple, causing aTypeErrorat runtime. Fixed tonp.empty((*x.shape[:-1], 0)).WeakSINDy.set_paramsmissing return value (_weak.py): Violated the sklearn convention of returningself, breaking method chaining (model.set_params(...).fit(...)). Addedreturn self.Variable shadowing in
_plan_weak_form(_weak.py):for lib in lib.libraries:shadowed the function parameter, with a nestedfor lib in lib.librariesgenerator compounding the issue. Renamed loop variables tosublib/slto eliminate the shadowing.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.