dynamicslab / pysindy

A package for the sparse identification of nonlinear dynamical systems from data
https://pysindy.readthedocs.io/en/latest/
Other
1.46k stars 324 forks source link

Extract common functionality from `SINDy` to `_BaseSINDy` #562

Closed Jacob-Stevens-Haas closed 1 month ago

Jacob-Stevens-Haas commented 1 month ago

Begin #351

This pull request begins the abstraction of the SINDy class, which handles a lot of methods with special cases, to a variety of classes that reflect fundamental differences between problem formulations. Here, I pull out _BaseSINDy, which contains basic information about the feature library, system dimension, and printing the equations.

Future PRs will make Weak and discrete their own classes, modify feature libraries to be amenable to jax, numpy, and cvxpy arrays, and introduce the Single-Step SINDy class and associated optimizer/problem setup.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 92.66055% with 8 lines in your changes missing coverage. Please review.

Project coverage is 95.26%. Comparing base (ddf8d6d) to head (22329dd). Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
pysindy/pysindy.py 91.37% 5 Missing :warning:
pysindy/feature_library/base.py 66.66% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #562 +/- ## ========================================== - Coverage 95.28% 95.26% -0.02% ========================================== Files 38 39 +1 Lines 4069 4099 +30 ========================================== + Hits 3877 3905 +28 - Misses 192 194 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Jacob-Stevens-Haas commented 1 month ago

Hey Alan, I put you as a reviewer in case you want an eye into this process. This is the beginning of what we talked about in the last meeting.

@ahsu98, @malachitewind, I'm going to add you as collaborators so you can review these changes too.

Jacob-Stevens-Haas commented 1 month ago

I'm going to merge it, and turn the last commit into an issue