From 50ddf0a9de9d1b7570f8469a6f4e8eca5e1f6b21 Mon Sep 17 00:00:00 2001 From: Chris Mutel Date: Wed, 3 Feb 2021 13:53:01 +0100 Subject: [PATCH] Make clearer that method applies to all numpy arrays --- bw_processing/datapackage.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/bw_processing/datapackage.py b/bw_processing/datapackage.py index 651d5ba..40d65e2 100644 --- a/bw_processing/datapackage.py +++ b/bw_processing/datapackage.py @@ -350,7 +350,7 @@ def add_persistent_vector( ) name = self._prepare_name(name) - self._add_array_resource( + self._add_numpy_array_resource( array=load_bytes(indices_array), name=name + ".indices", group=name, @@ -358,7 +358,7 @@ def add_persistent_vector( **kwargs, ) if data_array is not None: - self._add_array_resource( + self._add_numpy_array_resource( array=load_bytes(data_array), group=name, name=name + ".data", @@ -370,7 +370,7 @@ def add_persistent_vector( if (distributions_array["uncertainty_type"] < 2).sum() < len( distributions_array ): - self._add_array_resource( + self._add_numpy_array_resource( array=load_bytes(distributions_array), name=name + ".distributions", group=name, @@ -378,7 +378,7 @@ def add_persistent_vector( **kwargs, ) if flip_array is not None and flip_array.sum(): - self._add_array_resource( + self._add_numpy_array_resource( array=load_bytes(flip_array), group=name, name=name + ".flip", @@ -404,14 +404,14 @@ def add_persistent_array( ) name = self._prepare_name(name) - self._add_array_resource( + self._add_numpy_array_resource( array=load_bytes(data_array), name=name + ".data", group=name, kind="data", **kwargs, ) - self._add_array_resource( + self._add_numpy_array_resource( array=load_bytes(indices_array), name=name + ".indices", kind="indices", @@ -419,7 +419,7 @@ def add_persistent_array( **kwargs, ) if flip_array is not None and flip_array.sum(): - self._add_array_resource( + self._add_numpy_array_resource( array=load_bytes(flip_array), group=name, name=name + ".flip", @@ -427,7 +427,7 @@ def add_persistent_array( **kwargs, ) - def _add_array_resource( + def _add_numpy_array_resource( self, *, array: np.ndarray, name: str, matrix: str, kind: str, **kwargs ) -> None: filename = check_suffix(name, ".npy") @@ -557,7 +557,7 @@ def add_dynamic_vector( # Do something with dynamic vector - self._add_array_resource( + self._add_numpy_array_resource( array=load_bytes(indices_array), name=name + ".indices", group=name, @@ -565,7 +565,7 @@ def add_dynamic_vector( **kwargs, ) if flip_array is not None and flip_array.sum(): - self._add_array_resource( + self._add_numpy_array_resource( array=load_bytes(flip_array), group=name, name=name + ".flip", @@ -606,7 +606,7 @@ def add_dynamic_array( # Do something with dynamic vector - self._add_array_resource( + self._add_numpy_array_resource( array=load_bytes(indices_array), name=name + ".indices", group=name, @@ -614,7 +614,7 @@ def add_dynamic_array( **kwargs, ) if flip_array is not None: - self._add_array_resource( + self._add_numpy_array_resource( array=load_bytes(flip_array), group=name, name=name + ".flip",