Commit b7b808bf authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'fix_pickle' into 'NIFTy_5'

Fix pickle

See merge request ift/nifty-dev!112
parents 1deb0df3 3d6e53c2
...@@ -289,6 +289,10 @@ class SHTOperator(LinearOperator): ...@@ -289,6 +289,10 @@ class SHTOperator(LinearOperator):
else: else:
self.sjob.set_Healpix_geometry(target.nside) self.sjob.set_Healpix_geometry(target.nside)
def __reduce__(self):
return (_unpickleSHTOperator,
(list(self._domain), self._target[self._space], self._space))
def apply(self, x, mode): def apply(self, x, mode):
self._check_input(x, mode) self._check_input(x, mode)
if utilities.iscomplextype(x.dtype): if utilities.iscomplextype(x.dtype):
...@@ -337,6 +341,10 @@ class SHTOperator(LinearOperator): ...@@ -337,6 +341,10 @@ class SHTOperator(LinearOperator):
return Field(tdom, dobj.ensure_default_distributed(odat)) return Field(tdom, dobj.ensure_default_distributed(odat))
def _unpickleSHTOperator(*args):
return SHTOperator(*args)
class HarmonicTransformOperator(LinearOperator): class HarmonicTransformOperator(LinearOperator):
"""Transforms between a harmonic domain and a position domain counterpart. """Transforms between a harmonic domain and a position domain counterpart.
......
Markdown is supported
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