Skip to content

Commit

Permalink
Support numpy >= 2.x on Python >= 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Oct 9, 2024
1 parent 39dc8a7 commit a910d56
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/dicomweb_client/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,11 +857,12 @@ def _update_db(self):
getattr(ds, 'NumberOfFrames', '1')
),
number_of_pixels_per_frame=int(
np.prod([
(math.prod # type: ignore
if hasattr(math, 'prod') else np.prod)([
ds.Rows,
ds.Columns,
ds.SamplesPerPixel,
])
])
),
transfer_syntax_uid=transfer_syntax_uid,
bits_allocated=ds.BitsAllocated
Expand Down Expand Up @@ -2027,11 +2028,12 @@ def insert_instances(
getattr(ds, 'NumberOfFrames', '1')
),
number_of_pixels_per_frame=int(
np.prod([
(math.prod # type: ignore
if hasattr(math, 'prod') else np.prod)([
ds.Rows,
ds.Columns,
ds.SamplesPerPixel
])
])
),
transfer_syntax_uid=ds.file_meta.TransferSyntaxUID,
bits_allocated=ds.BitsAllocated
Expand Down

0 comments on commit a910d56

Please sign in to comment.