Update repr for classes that don't store arguments
@@ -102,6 +102,8 @@ class Intervention:
def __repr__(self):
''' Return a JSON-friendly output if possible, else revert to pretty repr '''
+
+ if hasattr(self, 'input_args'):
try:
json = self.to_json()
which = json['which']
@@ -111,6 +113,8 @@ class Intervention:
except Exception as E:
output = type(self) + f' ({str(E)})' # If that fails, print why
return output
+ else:
+ return f'{self.__module__}.{self.__class__.__name__}()'
def disp(self):
