File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -565,6 +565,11 @@ def __init__(
565565
566566 self ._create_db ()
567567
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+
568573 self ._attributes = {
569574 _QueryResourceType .STUDIES : self ._get_attributes (
570575 _QueryResourceType .STUDIES
@@ -857,7 +862,7 @@ def _update_db(self):
857862 getattr (ds , 'NumberOfFrames' , '1' )
858863 ),
859864 number_of_pixels_per_frame = int (
860- np . prod ([
865+ self . _prod ([ # type: ignore
861866 ds .Rows ,
862867 ds .Columns ,
863868 ds .SamplesPerPixel ,
@@ -2027,7 +2032,7 @@ def insert_instances(
20272032 getattr (ds , 'NumberOfFrames' , '1' )
20282033 ),
20292034 number_of_pixels_per_frame = int (
2030- np . prod ([
2035+ self . _prod ([ # type: ignore
20312036 ds .Rows ,
20322037 ds .Columns ,
20332038 ds .SamplesPerPixel
You can’t perform that action at this time.
0 commit comments