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
Neel Shah
NIFTy
Commits
ec4c6f1a
Commit
ec4c6f1a
authored
Nov 06, 2019
by
Martin Reinecke
Browse files
Merge branch 'more_operator_checks' into 'NIFTy_5'
More operator checks See merge request
!369
parents
acb3d258
956057e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
nifty5/extra.py
View file @
ec4c6f1a
...
...
@@ -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
,
target_dtype
=
np
.
float64
):
def
_actual_domain_check_nonlinear
(
op
,
loc
):
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, target_dtype=np.float64):
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
=
target_dtype
)
_actual_domain_check
(
reslin
.
jac
.
adjoint
,
inp
=
reslin
.
jac
(
loc
)
)
def
_domain_check
(
op
):
...
...
nifty5/library/light_cone_operator.py
View file @
ec4c6f1a
...
...
@@ -63,7 +63,7 @@ class _LightConeDerivative(LinearOperator):
if
mode
==
self
.
TIMES
:
res
+=
self
.
_derivatives
[
i
]
*
x
[
i
]
else
:
res
[
i
]
=
np
.
sum
(
self
.
_derivatives
[
i
]
*
x
)
res
[
i
]
=
np
.
sum
(
self
.
_derivatives
[
i
]
*
x
.
real
)
return
Field
.
from_global_data
(
self
.
_tgt
(
mode
),
res
)
...
...
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