def __repr__(self) -> str: repr_ = objecttools.assignrepr_values( values=self.get_filenames(), prefix=f"{type(self).__name__}(", width=70, ) return f"{repr_})"
def assignrepr(self, prefix='') -> str: """Return a |repr| string with a prefixed assignment.""" with objecttools.repr_.preserve_strings(True): with hydpy.pub.options.ellipsis(2, optional=True): prefix += '%s(' % objecttools.classname(self) repr_ = objecttools.assignrepr_values(sorted(self.names), prefix, 70) return repr_ + ')'
def assignrepr(self, prefix): """Return a |repr| string with an prefixed assignement. Argument: * prefix(|str|): Usually something like 'x = '. """ with objecttools.repr_.preserve_strings(True): with pub.options.ellipsis(2, optional=True): prefix += '%s(' % objecttools.classname(self) repr_ = objecttools.assignrepr_values(self.names, prefix, 70) return repr_ + ')'
def repr_(self, values, islong): prefix = '%s(' % self.name if self.NDIM == 0: string = '%s(%s)' % (self.name, objecttools.repr_(values)) elif self.NDIM == 1: if islong: string = objecttools.assignrepr_list(values, prefix, 75) + ')' else: string = objecttools.assignrepr_values( values, prefix, 75) + ')' elif self.NDIM == 2: string = objecttools.assignrepr_list2(values, prefix, 75) + ')' else: raise NotImplementedError( '`repr` does not yet support parameters or sequences like `%s`' 'of element `%s` which handle %d-dimensional matrices.' % self.NDIM) return '\n'.join(self.commentrepr() + [string])
def __repr__(self): return objecttools.assignrepr_values( self.filenames, 'Variable2Auxfile(', width=70) + ')'
def __repr__(self): return objecttools.assignrepr_values( self.modelnames, 'Auxfiler(', width=70) + ')'