File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
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 = math .prod if hasattr (math , 'prod' ) else np .prod
572+
568573 self ._attributes = {
569574 _QueryResourceType .STUDIES : self ._get_attributes (
570575 _QueryResourceType .STUDIES
@@ -584,10 +589,6 @@ def __init__(
584589 end = time .time ()
585590 elapsed = round (end - start )
586591 logger .info (f'updated database in { elapsed } seconds' )
587- # numpy 2 no longer has prod, but Python >= 3.8 does. We either have
588- # one or the other, so use the python math.prod method when available
589- # and fall abck to np if not.
590- self ._prod = math .prod if hasattr (math , 'prod' ) else np .prod
591592
592593 def __getstate__ (self ) -> dict :
593594 """Customize state for serialization via pickle module.
You can’t perform that action at this time.
0 commit comments