Commit c3a33c67 authored by csongor's avatar csongor

WIP: minor test fixes

parent bd1f7bc4
......@@ -1825,10 +1825,6 @@ class field(object):
raise AttributeError(about._errors.cstring(
"ERROR: The dtype of a space in the domain missmatches "
"the field's dtype."))
elif d.datamodel != self.datamodel:
raise AttributeError(about._errors.cstring(
"ERROR: The datamodel of a space in the domain missmatches "
"the field's datamodel."))
return domain
def check_codomain(self, domain, codomain):
......
......@@ -193,6 +193,8 @@ class rg_space(point_space):
# Initialize the power_indices object which takes care of kindex,
# pindex, rho and the pundex for a given set of parameters
# TODO harmonic = True doesn't work yet
if self.harmonic:
self.power_indices = rg_power_indices(
shape=self.get_shape(),
......
......@@ -80,27 +80,23 @@ space_list = []
# Add point_spaces
for param in itertools.product([1, 10],
all_point_datatypes,
DATAMODELS['point_space']):
space_list += [[point_space(num=param[0],
dtype=param[1],
datamodel=param[2])]]
all_point_datatypes):
space_list += [[point_space(num=param[0], dtype=param[1])]]
# Add rg_spaces
for param in itertools.product([(1,), (4, 6), (5, 8)],
[False, True],
[0, 1, 2],
[None, 0.3],
[False, True],
[False],
DATAMODELS['rg_space'],
fft_modules):
space_list += [[rg_space(shape=param[0],
space_list += [[(rg_space(shape=param[0],
zerocenter=param[1],
complexity=param[2],
distances=param[3],
harmonic=param[4],
datamodel=param[5],
fft_module=param[6])]]
fft_module=param[6]),param[6])]]
###############################################################################
......@@ -109,8 +105,8 @@ for param in itertools.product([(1,), (4, 6), (5, 8)],
class Test_field_init(unittest.TestCase):
@parameterized.expand(space_list)
def test_successfull_init_and_attributes(self, s):
f = field(domain=np.array([s]), dtype=s.dtype, datamodel=s.datamodel)
def test_successfull_init_and_attributes(self, s, datamodel):
f = field(domain=np.array([s]), dtype=s.dtype, datamodel=datamodel)
assert(f.domain[0] is s)
assert(s.check_codomain(f.codomain[0]))
......
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