Skip to content

Commit

Permalink
Replace deprecated np.product with np.prod (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpdunc23 authored Jul 26, 2024
1 parent 5736acd commit 4e63635
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions xpartition.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import collections
import dataclasses
import functools
import logging
import math
from typing import Callable, Dict, Hashable, Mapping, Sequence, Tuple, Union

import dask.array
import numpy as np
import xarray as xr
import dataclasses
import logging

from typing import Callable, Dict, Hashable, Mapping, Sequence, Tuple, Union


__version__ = "0.2.1"

Expand Down Expand Up @@ -296,7 +294,7 @@ def _optimal_meta_chunk_sizes(
for d, s in chunk_sizes.items():
block_size = math.ceil(self._obj.blocks.sizes[d] / s)
block_sizes.append(block_size)
blocks = np.product(block_sizes)
blocks = np.prod(block_sizes)
size = math.ceil(self._obj.blocks.sizes[dim] / (ranks // blocks))
chunk_sizes[dim] = min(size, self._obj.blocks.sizes[dim])
return chunk_sizes
Expand Down

0 comments on commit 4e63635

Please sign in to comment.