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
f737b474
Commit
f737b474
authored
Nov 26, 2018
by
Philipp Arras
Browse files
Add __repr__s
parent
c1b69ae1
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty5/operators/operator.py
View file @
f737b474
...
...
@@ -285,6 +285,11 @@ class _OpChain(_CombinedOperator):
newop
=
t_op
if
newop
is
None
else
op
(
newop
)
return
c_inp
,
newop
def
__repr__
(
self
):
subs
=
"
\n
"
.
join
(
sub
.
__repr__
()
for
sub
in
self
.
_ops
)
return
"_OpChain:
\n
"
+
indent
(
subs
)
class
_OpProd
(
Operator
):
def
__init__
(
self
,
op1
,
op2
):
from
..sugar
import
domain_union
...
...
@@ -333,6 +338,11 @@ class _OpProd(Operator):
cc
.
mult
(
f2
,
o2
.
target
)
return
cc
.
constfield
,
_OpProd
(
o1
,
o2
)
def
__repr__
(
self
):
subs
=
"
\n
"
.
join
(
sub
.
__repr__
()
for
sub
in
(
self
.
_op1
,
self
.
_op2
))
return
"_OpProd:
\n
"
+
indent
(
subs
)
class
_OpSum
(
Operator
):
def
__init__
(
self
,
op1
,
op2
):
from
..sugar
import
domain_union
...
...
@@ -380,3 +390,7 @@ class _OpSum(Operator):
cc
.
add
(
f1
,
o1
.
target
)
cc
.
add
(
f2
,
o2
.
target
)
return
cc
.
constfield
,
_OpSum
(
o1
,
o2
)
def
__repr__
(
self
):
subs
=
"
\n
"
.
join
(
sub
.
__repr__
()
for
sub
in
(
self
.
_op1
,
self
.
_op2
))
return
"_OpSum:
\n
"
+
indent
(
subs
)
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