@@ -598,6 +598,35 @@ def testSperr(self):
598598 compression_filter .filter_options , expected_filter .filter_options
599599 )
600600
601+ def testSZ3 (self ):
602+ for filter_options , expected_filter in (
603+ (
604+ (1 , 0 , 0 , 256 , 0 , 1058682594 , 3944497965 , 0 , 0 , 0 , 0 , 0 , 0 ),
605+ hdf5plugin .SZ3 (),
606+ ),
607+ (
608+ (1 , 0 , 0 , 256 , 0 , 1051772663 , 2696277389 , 0 , 0 , 0 , 0 , 0 , 0 ),
609+ hdf5plugin .SZ3 (absolute = 1e-6 ),
610+ ),
611+ (
612+ (1 , 0 , 0 , 256 , 1 , 0 , 0 , 1062232653 , 3539053052 , 0 , 0 , 0 , 0 ),
613+ hdf5plugin .SZ3 (relative = 1e-3 ),
614+ ),
615+ (
616+ (1 , 0 , 0 , 256 , 2 , 0 , 0 , 0 , 0 , 1062232653 , 3539053052 , 0 , 0 ),
617+ hdf5plugin .SZ3 (norm2 = 1e-3 ),
618+ ),
619+ (
620+ (1 , 0 , 0 , 256 , 3 , 0 , 0 , 0 , 0 , 0 , 0 , 1062232653 , 3539053052 ),
621+ hdf5plugin .SZ3 (peak_signal_to_noise_ratio = 1e-3 ),
622+ ),
623+ ):
624+ with self .subTest (filter_options = filter_options ):
625+ compression_filter = hdf5plugin .SZ3 .from_filter_options (filter_options )
626+ self .assertEqual (
627+ compression_filter .filter_options , expected_filter .filter_options
628+ )
629+
601630 def testZstd (self ):
602631 for filter_options , expected_options in (
603632 # (clevel,)
@@ -669,6 +698,11 @@ def testSperr(self):
669698 data = numpy .arange (256 ** 2 , dtype = numpy .float32 ).reshape (256 , 256 )
670699 self ._test (hdf5plugin .Sperr (), data )
671700
701+ @unittest .skipUnless (should_test ("sz3" ), "SZ3 filter not available" )
702+ def testSZ3 (self ):
703+ data = numpy .arange (256 ** 2 , dtype = numpy .float32 ).reshape (256 , 256 )
704+ self ._test (hdf5plugin .SZ3 (), data )
705+
672706 @unittest .skipUnless (should_test ("zstd" ), "Zstd filter not available" )
673707 def testZstd (self ):
674708 data = numpy .arange (256 ** 2 , dtype = numpy .float32 ).reshape (256 , 256 )
0 commit comments