From 0f11a31c7a968241437e7c442abf0c73e80b0f7b Mon Sep 17 00:00:00 2001 From: ultimanet <ultimanet@users.noreply.github.com> Date: Tue, 24 Mar 2015 13:20:21 +0100 Subject: [PATCH] nifty_mpi_data: added __pos__ to distributed_data_object --- nifty_mpi_data.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/nifty_mpi_data.py b/nifty_mpi_data.py index d7652c807..c14a68d35 100644 --- a/nifty_mpi_data.py +++ b/nifty_mpi_data.py @@ -1,4 +1,26 @@ # -*- coding: utf-8 -*- +## NIFTY (Numerical Information Field Theory) has been developed at the +## Max-Planck-Institute for Astrophysics. +## +## Copyright (C) 2015 Max-Planck-Society +## +## Author: Theo Steininger +## Project homepage: <http://www.mpa-garching.mpg.de/ift/nifty/> +## +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +## See the GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see <http://www.gnu.org/licenses/>. + + ##initialize the 'found-packages'-dictionary found = {} @@ -93,6 +115,13 @@ class distributed_data_object(object): def __repr__(self): return '<distributed_data_object>\n'+self.data.__repr__() + def __pos__(self): + temp_d2o = distributed_data_object(global_shape=self.shape, + dtype=self.dtype, + distribution_strategy=self.distribution_strategy) + temp_d2o.set_local_data(data = self.get_local_data()) + return temp_d2o + def __neg__(self): temp_d2o = distributed_data_object(global_shape=self.shape, dtype=self.dtype, -- GitLab