File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -565,6 +565,11 @@ def __init__(
565
565
566
566
self ._create_db ()
567
567
568
+ # numpy 2 no longer has prod, but Python >= 3.8 does. We either have
569
+ # one or the other, so use the python math.prod method when available
570
+ # and fall abck to np if not.
571
+ self ._prod = getattr (math , 'prod' , np .prod )
572
+
568
573
self ._attributes = {
569
574
_QueryResourceType .STUDIES : self ._get_attributes (
570
575
_QueryResourceType .STUDIES
@@ -857,7 +862,7 @@ def _update_db(self):
857
862
getattr (ds , 'NumberOfFrames' , '1' )
858
863
),
859
864
number_of_pixels_per_frame = int (
860
- np . prod ([
865
+ self . _prod ([ # type: ignore
861
866
ds .Rows ,
862
867
ds .Columns ,
863
868
ds .SamplesPerPixel ,
@@ -2027,7 +2032,7 @@ def insert_instances(
2027
2032
getattr (ds , 'NumberOfFrames' , '1' )
2028
2033
),
2029
2034
number_of_pixels_per_frame = int (
2030
- np . prod ([
2035
+ self . _prod ([ # type: ignore
2031
2036
ds .Rows ,
2032
2037
ds .Columns ,
2033
2038
ds .SamplesPerPixel
You can’t perform that action at this time.
0 commit comments