Commit e0771e65 authored by Philipp Arras's avatar Philipp Arras
Browse files

Add string representation for models

parent 7be5d63d
Pipeline #31663 failed with stages
in 5 minutes and 44 seconds
......@@ -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\nValue domain:\n{}\n'.format(self.position.domain, self.value.domain)
s += '--------------------------------------------------------------------------------\n'
return s
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment