Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
c3a33c67
Commit
c3a33c67
authored
May 26, 2016
by
csongor
Browse files
WIP: minor test fixes
parent
bd1f7bc4
Changes
3
Hide whitespace changes
Inline
Side-by-side
nifty_core.py
View file @
c3a33c67
...
...
@@ -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
):
...
...
rg/nifty_rg.py
View file @
c3a33c67
...
...
@@ -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
(),
...
...
test/test_nifty_field.py
View file @
c3a33c67
...
...
@@ -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
]))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment