Commit 30f574e0 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

allow write-locking of data oojects

parent 1a790855
......@@ -517,3 +517,11 @@ def transpose(arr):
def default_distaxis():
return 0
def lock(arr):
arr._data.flags.writeable = False
def locked(arr):
return not arr._data.flags.writeable
......@@ -91,3 +91,11 @@ def default_distaxis():
def local_shape(glob_shape, distaxis=-1):
return glob_shape
def lock(arr):
arr.flags.writeable = False
def locked(arr):
return not arr.flags.writeable
......@@ -11,7 +11,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <>.
# Copyright(C) 2013-2017 Max-Planck-Society
# Copyright(C) 2013-2018 Max-Planck-Society
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
......@@ -33,4 +33,5 @@ __all__ = ["ntask", "rank", "master", "local_shape", "data_object", "full",
"log", "tanh", "sqrt", "from_object", "from_random",
"local_data", "ibegin", "ibegin_from_shape", "np_allreduce_sum",
"distaxis", "from_local_data", "from_global_data", "to_global_data",
"redistribute", "default_distaxis", "mprint", "is_numpy"]
"redistribute", "default_distaxis", "mprint", "is_numpy",
"lock", "locked"]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment