Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
0f11a31c
Commit
0f11a31c
authored
Mar 24, 2015
by
ultimanet
Browse files
nifty_mpi_data: added __pos__ to distributed_data_object
parent
fcc82a10
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty_mpi_data.py
View file @
0f11a31c
# -*- 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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment