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

adds round_to_int boolean argument to FixedScaleOffset #558

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

point9repeating
Copy link

Makes it possible to apply this filter without automatically converting to integers. #549

Chris Johnson added 2 commits August 8, 2024 19:53
Copy link

codecov bot commented Aug 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.91%. Comparing base (9617e6f) to head (e26b712).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #558   +/-   ##
=======================================
  Coverage   99.91%   99.91%           
=======================================
  Files          59       59           
  Lines        2339     2349   +10     
=======================================
+ Hits         2337     2347   +10     
  Misses          2        2           
Files Coverage Δ
numcodecs/fixedscaleoffset.py 100.00% <100.00%> (ø)
numcodecs/tests/test_fixedscaleoffset.py 100.00% <100.00%> (ø)

Copy link
Contributor

@dstansby dstansby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this - looks like a nice change, and sorry it took so long to review. I have one suggestion, which is to make the new argument keyword only.

@@ -70,10 +72,11 @@ class FixedScaleOffset(Codec):

codec_id = 'fixedscaleoffset'

def __init__(self, offset, scale, dtype, astype=None):
def __init__(self, offset, scale, dtype, astype=None, round_to_int=True):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def __init__(self, offset, scale, dtype, astype=None, round_to_int=True):
def __init__(self, offset, scale, dtype, astype=None, *, round_to_int=True):

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