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
54aa8414
Commit
54aa8414
authored
Jun 27, 2018
by
Philipp Arras
Browse files
Revert casting of Field to Model
parent
e53f2d33
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty5/models/model.py
View file @
54aa8414
...
...
@@ -50,10 +50,7 @@ class Model(NiftyMetaBase()):
if
isinstance
(
other
,
Model
):
from
.binary_helpers
import
Add
return
Add
.
make
(
self
,
other
)
if
isinstance
(
other
,
(
Field
,
MultiField
)):
from
.constant
import
Constant
return
self
.
__add__
(
Constant
(
self
.
position
,
other
))
raise
TypeError
return
NotImplemented
def
__sub__
(
self
,
other
):
return
self
.
__add__
((
-
1
)
*
other
)
...
...
@@ -67,12 +64,12 @@ class Model(NiftyMetaBase()):
return
Mul
.
make
(
self
,
other
)
if
isinstance
(
other
,
(
Field
,
MultiField
)):
return
makeOp
(
other
)(
self
)
r
aise
NotImplemented
Error
r
eturn
NotImplemented
def
__rmul__
(
self
,
other
):
if
isinstance
(
other
,
(
float
,
int
,
Field
)):
return
self
.
__mul__
(
other
)
r
aise
NotImplemented
Error
r
eturn
NotImplemented
def
__str__
(
self
):
s
=
(
'----------------------------------------'
...
...
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