Skip to content
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

Simpler inputs #362

Merged
merged 6 commits into from
Jul 14, 2023
Merged

Simpler inputs #362

merged 6 commits into from
Jul 14, 2023

Conversation

Jacob-Stevens-Haas
Copy link
Collaborator

Fixes #306

Only thing to consider is whether we want to enforce sorted inputs_per_library. I maintained current behavior in cases, where

imputs_per_library=[[2,0]]

might cause some nonsensical behavior, since arr[[2,0]] != arr[[0,2]], but also might make no difference since it applies the same to feature names. Can easily change this to automatically sort inputs if people want.

Remove inputs_per_library as it's not in function signature.
Reorder feature and parameter kwargs to match signature
Removed explicit attributes, referenced superclass IAW PEP 257
Removed include_bias=True from parameter_lib default - include_bias is true by
    default
Annotated types
Add escape hatch in GeneralizedLibrary so old-style arrays work (but are warned)

Also:
* unique elements of a list that preserves order requires an idiom, so I've
    extracted it to its own function.  do we want sorted()?
* Add more type annotations
* the following sklearn API fixes to generalized_library:
    Remove attribute when has same name as parameter in docstrings
    Remove trailing underscore on hyperparamters
    Do not set trailing underscore on fitted parameters in __init__ (breaks
        check_if_fitted)
With removal of legacy ensembling, only feature libraries that inherit
a non-trivial init are ParameterizedLibrary and PolynomialLibrary
@codecov
Copy link

codecov bot commented Jul 10, 2023

Codecov Report

Patch coverage: 95.71% and project coverage change: -0.26 ⚠️

Comparison is base (ac61b4a) 93.95% compared to head (044b4f5) 93.70%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #362      +/-   ##
==========================================
- Coverage   93.95%   93.70%   -0.26%     
==========================================
  Files          37       37              
  Lines        3688     3589      -99     
==========================================
- Hits         3465     3363     -102     
- Misses        223      226       +3     
Impacted Files Coverage Δ
pysindy/feature_library/custom_library.py 100.00% <ø> (ø)
pysindy/feature_library/fourier_library.py 100.00% <ø> (ø)
pysindy/feature_library/identity_library.py 96.55% <ø> (-0.42%) ⬇️
pysindy/feature_library/pde_library.py 95.45% <ø> (-0.08%) ⬇️
pysindy/feature_library/polynomial_library.py 96.10% <ø> (-1.96%) ⬇️
pysindy/feature_library/sindy_pi_library.py 96.00% <ø> (+0.68%) ⬆️
pysindy/feature_library/weak_pde_library.py 95.84% <ø> (+0.22%) ⬆️
pysindy/optimizers/base.py 92.30% <83.33%> (+0.70%) ⬆️
pysindy/feature_library/generalized_library.py 87.82% <92.85%> (-9.52%) ⬇️
pysindy/feature_library/base.py 96.61% <100.00%> (+0.69%) ⬆️
... and 2 more

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Jacob-Stevens-Haas Jacob-Stevens-Haas merged commit d440771 into master Jul 14, 2023
5 of 6 checks passed
@Jacob-Stevens-Haas Jacob-Stevens-Haas deleted the simpler-inputs branch July 14, 2023 17:15
jpcurbelo pushed a commit to jpcurbelo/pysindy_fork that referenced this pull request Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simpler inputs_per_library in GeneralizedLibrary?
1 participant