From 4e636359d64448c429f63921a9d38207b5c94203 Mon Sep 17 00:00:00 2001 From: James Duncan Date: Fri, 26 Jul 2024 07:48:09 -0700 Subject: [PATCH] Replace deprecated `np.product` with `np.prod` (#24) --- xpartition.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/xpartition.py b/xpartition.py index a4a343a..a9a3528 100644 --- a/xpartition.py +++ b/xpartition.py @@ -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" @@ -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