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

Label get param #306

Open
wants to merge 74 commits into
base: development
Choose a base branch
from
Open

Label get param #306

wants to merge 74 commits into from

Conversation

BalzaniEdoardo
Copy link
Collaborator

This PR addresses the following

  1. Add a __getitem__ to Basis. Labels can be used to get the desired basis in the tree.
  2. Improved label logic:
    • User provided labels in composite basis must be unique.
    • Default labels in composite bases (class name) is disambiguated by appending _<number>.
    • Labeling a basis using another basis type class name results in an error.
  3. get_params and set_params override default behavior: instead of reflecting the full attribute structure, basis1__basis2...__parameter_name, the parameter key is set to <label>_parameter_name.

For a concrete example, refer to the new how-to note: handling_composite_bases.md

@BalzaniEdoardo BalzaniEdoardo marked this pull request as ready for review February 11, 2025 00:36
@codecov-commenter
Copy link

codecov-commenter commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 96.39344% with 11 lines in your changes missing coverage. Please review.

Project coverage is 97.08%. Comparing base (07a9b22) to head (67f7548).
Report is 5 commits behind head on development.

Files with missing lines Patch % Lines
src/nemos/basis/_basis_mixin.py 96.62% 6 Missing ⚠️
src/nemos/basis/_basis.py 96.19% 4 Missing ⚠️
src/nemos/basis/_transformer_basis.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           development     #306      +/-   ##
===============================================
- Coverage        97.40%   97.08%   -0.33%     
===============================================
  Files               35       35              
  Lines             2854     3120     +266     
===============================================
+ Hits              2780     3029     +249     
- Misses              74       91      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

2 participants