From ad862d52dba21f02bdacec48e02b45cf0dac98e9 Mon Sep 17 00:00:00 2001 From: Theo Steininger <theo.steininger@ultimanet.de> Date: Mon, 12 Jun 2017 03:39:43 +0200 Subject: [PATCH] Fixed distribute_data for global_shape == () --- d2o/distributed_data_object.py | 2 +- d2o/distributor_factory.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/d2o/distributed_data_object.py b/d2o/distributed_data_object.py index 1106635..7dbffbf 100644 --- a/d2o/distributed_data_object.py +++ b/d2o/distributed_data_object.py @@ -189,7 +189,7 @@ class distributed_data_object(Loggable, Versionable, object): dtype=dtype, **kwargs) - self.distribution_strategy = distribution_strategy + self.distribution_strategy = self.distributor.distribution_strategy self.dtype = self.distributor.dtype self.shape = self.distributor.global_shape self.local_shape = self.distributor.local_shape diff --git a/d2o/distributor_factory.py b/d2o/distributor_factory.py index 13762bc..48c7fe0 100644 --- a/d2o/distributor_factory.py +++ b/d2o/distributor_factory.py @@ -320,7 +320,7 @@ class distributor(object): result_data = np.empty(self.local_shape, dtype=self.dtype) elif np.isscalar(data): result_data = np.empty(self.local_shape, dtype=self.dtype) - result_data[:] = data + result_data[()] = data elif isinstance(data, np.ndarray) or \ isinstance(data, distributed_data_object) or \ h5py_dataset_Q: -- GitLab