Commit a141f65a authored by Martin Reinecke's avatar Martin Reinecke

make PowerSpace a non-harmonic space

parent 9e708e60
......@@ -53,7 +53,7 @@ class PowerSpace(Space):
dim : np.int
Total number of dimensionality, i.e. the number of pixels.
harmonic : bool
Always True for this space.
Always False for this space.
shape : tuple of np.ints
The shape of the space's data array.
binbounds : tuple or None
......@@ -189,7 +189,7 @@ class PowerSpace(Space):
@property
def harmonic(self):
return True
return False
@property
def shape(self):
......@@ -205,13 +205,6 @@ class PowerSpace(Space):
def dvol(self):
return self._dvol
def get_k_length_array(self):
return self.k_lengths.copy()
def get_fft_smoothing_kernel_function(self, sigma):
raise NotImplementedError(
"There is no fft smoothing function for PowerSpace.")
# ---Added properties and methods---
@property
......
......@@ -49,7 +49,7 @@ CONSTRUCTOR_CONFIGS = [
[1, False, None, None, {'error': (ValueError, NotImplementedError)}],
[RGSpace((8,)), False, None, None, {'error': ValueError}],
[RGSpace((8,), harmonic=True), None, None, None, {
'harmonic': True,
'harmonic': False,
'shape': (5,),
'dim': 5,
'harmonic_partner': RGSpace((8,), harmonic=True),
......@@ -58,7 +58,7 @@ CONSTRUCTOR_CONFIGS = [
'k_lengths': np.array([0., 1., 2., 3., 4.]),
}],
[RGSpace((8,), harmonic=True), True, None, None, {
'harmonic': True,
'harmonic': False,
'shape': (4,),
'dim': 4,
'harmonic_partner': RGSpace((8,), harmonic=True),
......@@ -69,7 +69,7 @@ CONSTRUCTOR_CONFIGS = [
]
def get_k_length_array_configs():
def k_lengths_configs():
da_0 = np.array([0, 1.0, 1.41421356, 2., 2.23606798, 2.82842712])
return [
[RGSpace((4, 4), harmonic=True), da_0],
......@@ -119,10 +119,10 @@ class PowerSpaceFunctionalityTest(unittest.TestCase):
else:
assert_equal(getattr(p, key), value)
@expand(get_k_length_array_configs())
def test_k_length_array(self, harmonic_partner, expected):
@expand(k_lengths_configs())
def test_k_lengths(self, harmonic_partner, expected):
p = PowerSpace(harmonic_partner=harmonic_partner)
assert_almost_equal(p.get_k_length_array(), expected)
assert_almost_equal(p.k_lengths, expected)
def test_dvol(self):
hp = RGSpace(10,harmonic=True)
......
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