@@ -75,7 +75,7 @@ class FilterBase(h5py.filters.FilterRefBase):
7575 filter_id : int
7676 filter_name : str
7777
78- def _init (
78+ def __init__ (
7979 self ,
8080 filter_options : tuple [int , ...] = (),
8181 config : Mapping [str , int | float | bool | str ] | None = None ,
@@ -189,7 +189,7 @@ def __init__(
189189 if cname == "zstd" :
190190 filter_options += (clevel ,)
191191 config ["clevel" ] = clevel
192- self . _init (filter_options , config )
192+ super (). __init__ (filter_options , config )
193193
194194 @property
195195 def nelems (self ) -> int :
@@ -294,7 +294,7 @@ def __init__(
294294 if shuffle not in (self .NOSHUFFLE , self .SHUFFLE , self .BITSHUFFLE ):
295295 raise ValueError (f"shuffle={ shuffle } is not supported" )
296296
297- self . _init (
297+ super (). __init__ (
298298 filter_options = (0 , 0 , 0 , 0 , clevel , shuffle , compression ),
299299 config = {"cname" : cname , "clevel" : clevel , "shuffle" : shuffle },
300300 )
@@ -411,7 +411,7 @@ def __init__(
411411 self .TRUNC_PREC ,
412412 ):
413413 raise ValueError (f"filters={ filters } is not supported" )
414- self . _init (
414+ super (). __init__ (
415415 filter_options = (0 , 0 , 0 , 0 , clevel , filters , compression ),
416416 config = {"cname" : cname , "clevel" : clevel , "filters" : filters },
417417 )
@@ -480,7 +480,7 @@ def __init__(self, blocksize: int = 9):
480480 if not 1 <= blocksize <= 9 :
481481 raise ValueError ("blocksize must be in the range [1, 9]" )
482482
483- self . _init (
483+ super (). __init__ (
484484 filter_options = (blocksize ,),
485485 config = {"blocksize" : blocksize },
486486 )
@@ -525,7 +525,7 @@ def __init__(self) -> None:
525525 "The FciDecomp filter is not available as hdf5plugin was not built with C++11.\n "
526526 "You may need to reinstall hdf5plugin with a recent version of pip, or rebuild it with a newer compiler."
527527 )
528- self . _init (filter_options = (), config = {})
528+ super (). __init__ (filter_options = (), config = {})
529529
530530 @classmethod
531531 def _from_filter_options (cls , filter_options : tuple [int , ...]) -> FciDecomp :
@@ -559,7 +559,7 @@ def __init__(self, nbytes: int = 0):
559559 nbytes = int (nbytes )
560560 if not 0 <= nbytes <= 0x7E000000 :
561561 raise ValueError ("clevel must be in the range [0, 2113929216]" )
562- self . _init (
562+ super (). __init__ (
563563 filter_options = (nbytes ,),
564564 config = {"nbytes" : nbytes },
565565 )
@@ -729,7 +729,7 @@ def __init__(
729729 filter_options = ()
730730 config = {}
731731
732- self . _init (filter_options , config )
732+ super (). __init__ (filter_options , config )
733733
734734 # From zfp.h
735735 _ZFP_MIN_BITS = 1 # minimum number of bits per block
@@ -915,7 +915,7 @@ def __init__(
915915 mode = 1
916916 quality = 16 if rate is None else rate
917917
918- self . _init (
918+ super (). __init__ (
919919 filter_options = self .__pack_options (mode , quality , swap , missing_value_mode ),
920920 config = {
921921 mode_name : quality ,
@@ -1126,7 +1126,7 @@ def __init__(
11261126 logger .info (f"SZ mode { sz_mode } used." )
11271127 logger .info (f"filter options { filter_options } " )
11281128
1129- self . _init (filter_options , config )
1129+ super (). __init__ (filter_options , config )
11301130
11311131 @classmethod
11321132 def _from_filter_options (cls , filter_options : tuple [int , ...]) -> SZ :
@@ -1227,7 +1227,7 @@ def __init__(
12271227 if len (filter_options ) != 9 :
12281228 raise IndexError ("Invalid number of arguments" )
12291229
1230- self . _init (filter_options , config )
1230+ super (). __init__ (filter_options , config )
12311231
12321232 @classmethod
12331233 def _from_filter_options (cls , filter_options : tuple [int , ...]) -> SZ3 :
@@ -1259,7 +1259,7 @@ def _from_filter_options(cls, filter_options: tuple[int, ...]) -> SZ3:
12591259
12601260
12611261class Zstd (FilterBase ):
1262- """``h5py.Group.create_dataset``'s compression arguments for using FciDecomp filter.
1262+ """``h5py.Group.create_dataset``'s compression arguments for using Zstd filter.
12631263
12641264 .. code-block:: python
12651265
@@ -1280,7 +1280,7 @@ class Zstd(FilterBase):
12801280 def __init__ (self , clevel : int = 3 ):
12811281 if not 1 <= clevel <= 22 :
12821282 raise ValueError ("clevel must be in the range [1, 22]" )
1283- self . _init (
1283+ super (). __init__ (
12841284 filter_options = (clevel ,),
12851285 config = {"clevel" : clevel },
12861286 )
0 commit comments