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
b08d9e1b
Commit
b08d9e1b
authored
Mar 13, 2019
by
Philipp Arras
Browse files
More sophisticated __repr__ for FieldAdapter
parent
4be4bc7f
Pipeline
#45203
passed with stages
in 8 minutes and 11 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty5/operators/simple_linear_operators.py
View file @
b08d9e1b
...
...
@@ -147,7 +147,16 @@ class FieldAdapter(LinearOperator):
return
MultiField
(
self
.
_tgt
(
mode
),
(
x
,))
def
__repr__
(
self
):
return
'FieldAdapter'
s
=
'FieldAdapter'
dom
=
isinstance
(
self
.
_domain
,
MultiDomain
)
tgt
=
isinstance
(
self
.
_target
,
MultiDomain
)
if
dom
and
tgt
:
s
+=
' {} <- {}'
.
format
(
self
.
_target
.
keys
(),
self
.
_domain
.
keys
())
elif
dom
:
s
+=
' <- {}'
.
format
(
self
.
_domain
.
keys
())
elif
tgt
:
s
+=
' {} <-'
.
format
(
self
.
_target
.
keys
())
return
s
class
_SlowFieldAdapter
(
LinearOperator
):
...
...
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