Skip to content
GitLab
Menu
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
34cee01c
Commit
34cee01c
authored
Nov 06, 2019
by
Philipp Arras
Browse files
Fixup new checks
parent
cf3fc29e
Pipeline
#63089
failed with stages
in 5 minutes and 51 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty5/extra.py
View file @
34cee01c
...
...
@@ -95,7 +95,7 @@ def _actual_domain_check(op, domain_dtype=None, inp=None):
assert_
(
op
(
inp
).
domain
is
op
.
target
)
def
_actual_domain_check_nonlinear
(
op
,
loc
):
def
_actual_domain_check_nonlinear
(
op
,
loc
,
target_dtype
=
np
.
float64
):
assert
isinstance
(
loc
,
(
Field
,
MultiField
))
assert_
(
loc
.
domain
is
op
.
domain
)
lin
=
Linearization
.
make_var
(
loc
,
False
)
...
...
@@ -112,7 +112,7 @@ def _actual_domain_check_nonlinear(op, loc):
assert_
(
reslin
.
jac
.
domain
is
reslin
.
domain
)
assert_
(
reslin
.
jac
.
target
is
reslin
.
target
)
_actual_domain_check
(
reslin
.
jac
,
inp
=
loc
)
_actual_domain_check
(
reslin
.
jac
.
adjoint
,
domain_dtype
=
np
.
float64
)
_actual_domain_check
(
reslin
.
jac
.
adjoint
,
domain_dtype
=
target_dtype
)
def
_domain_check
(
op
):
...
...
@@ -158,8 +158,8 @@ def consistency_check(op, domain_dtype=np.float64, target_dtype=np.float64,
raise
TypeError
(
'This test tests only linear operators.'
)
_domain_check
(
op
)
_actual_domain_check
(
op
,
domain_dtype
)
_actual_domain_check
(
op
.
adjoint
,
domain
_dtype
)
_actual_domain_check
(
op
.
inverse
,
domain
_dtype
)
_actual_domain_check
(
op
.
adjoint
,
target
_dtype
)
_actual_domain_check
(
op
.
inverse
,
target
_dtype
)
_actual_domain_check
(
op
.
adjoint
.
inverse
,
domain_dtype
)
_check_linearity
(
op
,
domain_dtype
,
atol
,
rtol
)
_check_linearity
(
op
.
adjoint
,
target_dtype
,
atol
,
rtol
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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