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

fix: replace mutable empty list by None in Filter class constructor #214

Merged
merged 12 commits into from
Jan 27, 2025

Conversation

ansaminard
Copy link
Collaborator

@ansaminard ansaminard commented Jan 20, 2025

In class Filter, use None as default value for A/B coefficient lists to avoid issues related to the mutable nature of lists

Also:

  • added details in class docstring
  • replaced == [] tests with len() == 0 tests to avoid not-the-same-shape errors when coefficients are passed as numpy arrays (instead of lists)
  • cast to list upon calling the operator to avoid DPF errors when coefficients are passed as numpy arrays (instead of lists)

@ansaminard ansaminard marked this pull request as draft January 20, 2025 16:33
Copy link

codecov bot commented Jan 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (cd82963) to head (7fcbc6c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #214   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           75        75           
  Lines         4367      4367           
=========================================
  Hits          4367      4367           

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

@ansaminard ansaminard marked this pull request as ready for review January 23, 2025 09:03
@ansaminard ansaminard enabled auto-merge (squash) January 27, 2025 13:52
@ansaminard ansaminard merged commit b65c8a8 into main Jan 27, 2025
26 checks passed
@ansaminard ansaminard deleted the bug/filter-constructor-coefficients branch January 27, 2025 18:38
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.

Class filter may cause hidden issues because it uses mutable default values in its constructor
4 participants