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

no copy() for spaces

parent 91299591
Pipeline #18993 passed with stage
in 4 minutes and 22 seconds
......@@ -109,9 +109,6 @@ class GLSpace(Space):
def total_volume(self):
return 4 * np.pi
def copy(self):
return self.__class__(nlat=self.nlat, nlon=self.nlon)
def scalar_weight(self):
return None
......
......@@ -104,9 +104,6 @@ class HPSpace(Space):
def total_volume(self):
return 4 * np.pi
def copy(self):
return self.__class__(nside=self.nside)
def scalar_weight(self):
return np.pi / (3*self._nside*self._nside)
......
......@@ -114,9 +114,6 @@ class LMSpace(Space):
# the individual pixels have a fixed volume of 1.
return np.float64(self.dim)
def copy(self):
return self.__class__(lmax=self.lmax)
def scalar_weight(self):
return 1.
......
......@@ -204,10 +204,6 @@ class PowerSpace(Space):
# every power-pixel has a volume of 1
return float(reduce(lambda x, y: x*y, self.pindex.shape))
def copy(self):
return self.__class__(harmonic_partner=self.harmonic_partner,
binbounds=self._binbounds)
def scalar_weight(self):
return None
......
......@@ -110,11 +110,6 @@ class RGSpace(Space):
def total_volume(self):
return self.dim * self._wgt
def copy(self):
return self.__class__(shape=self.shape,
distances=self.distances,
harmonic=self.harmonic)
def scalar_weight(self):
return self._wgt
......
......@@ -77,17 +77,6 @@ class Space(DomainObject):
raise NotImplementedError(
"There is no generic volume for the Space base class.")
@abc.abstractmethod
def copy(self):
""" Returns a copy of this Space instance.
Returns
-------
Space
A copy of this instance.
"""
return self.__class__()
def get_k_length_array(self):
""" The length of the k vector for every pixel.
This method is only implemented for harmonic spaces.
......
......@@ -46,13 +46,6 @@ class SpaceInterfaceTests(unittest.TestCase):
*method_expected_type[1:-1])) is
method_expected_type[-1])
@expand([[space] for space in generate_spaces()])
def test_copy(self, space):
# make sure it's a deep copy
assert_(space is not space.copy())
# make sure contents are the same
assert_equal(space, space.copy())
@expand([[space] for space in generate_spaces()])
def test_repr(self, space):
assert_(space == eval(space.__repr__()))
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