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
On Thursday, 7th July from 1 to 3 pm there will be a maintenance with a short downtime of GitLab.
Open sidebar
ift
NIFTy
Commits
e0771e65
Commit
e0771e65
authored
Jun 23, 2018
by
Philipp Arras
Browse files
Add string representation for models
parent
7be5d63d
Pipeline
#31663
failed with stages
in 5 minutes and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty5/models/model.py
View file @
e0771e65
...
...
@@ -73,3 +73,10 @@ class Model(NiftyMetaBase()):
if
isinstance
(
other
,
(
float
,
int
,
Field
)):
return
self
.
__mul__
(
other
)
raise
NotImplementedError
def
__str__
(
self
):
s
=
'--------------------------------------------------------------------------------
\n
'
s
+=
'<Nifty Model at {}>
\n\n
'
.
format
(
hex
(
id
(
self
)))
s
+=
'Position domain:
\n
{}
\n\n
Value domain:
\n
{}
\n
'
.
format
(
self
.
position
.
domain
,
self
.
value
.
domain
)
s
+=
'--------------------------------------------------------------------------------
\n
'
return
s
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