Exemplo n.º 1
0
 def __repr__(self):
     """Return ``repr(self)``."""
     if self.ndim == 1:
         return '{}({!r}, {!r})'.format(self.__class__.__name__,
                                        self.min_pt[0], self.max_pt[0])
     else:
         return '{}({}, {})'.format(self.__class__.__name__,
                                    array1d_repr(self.min_pt),
                                    array1d_repr(self.max_pt))
Exemplo n.º 2
0
 def __repr__(self):
     """Return ``repr(self)``."""
     if self.ndim == 1:
         return '{}({!r}, {!r})'.format(self.__class__.__name__,
                                        self.min_pt[0],
                                        self.max_pt[0])
     else:
         return '{}({}, {})'.format(self.__class__.__name__,
                                    array1d_repr(self.min_pt),
                                    array1d_repr(self.max_pt))
Exemplo n.º 3
0
 def repr_part(self):
     """String usable in a space's ``__repr__`` method."""
     optargs = [('weighting', array1d_repr(self.array, nprint=10), ''),
                ('exponent', self.exponent, 2.0),
                ('dist_using_inner', self.dist_using_inner, False)]
     return signature_string([],
                             optargs,
                             sep=[',\n', ', ', ',\n'],
                             mod=[[], ['!s', '', '']])
Exemplo n.º 4
0
 def __repr__(self):
     """Return ``repr(self)``."""
     if self.is_uniform:
         constructor = 'uniform_grid'
         posargs = [list(self.min_pt), list(self.max_pt), self.shape]
         inner_str = signature_string(posargs, [])
         return '{}({})'.format(constructor, inner_str)
     else:
         constructor = self.__class__.__name__
         posargs = [array1d_repr(v) for v in self.coord_vectors]
         inner_str = signature_string(posargs, [], sep=[',\n', ', ', ', '],
                                      mod=['!s', ''])
         return '{}(\n{}\n)'.format(constructor, indent_rows(inner_str))
Exemplo n.º 5
0
Arquivo: grid.py Projeto: hmpku/odl
 def __repr__(self):
     """Return ``repr(self)``."""
     if self.is_uniform:
         constructor = 'uniform_grid'
         posargs = [list(self.min_pt), list(self.max_pt), self.shape]
         inner_str = signature_string(posargs, [])
         return '{}({})'.format(constructor, inner_str)
     else:
         constructor = self.__class__.__name__
         posargs = [array1d_repr(v) for v in self.coord_vectors]
         inner_str = signature_string(posargs, [], sep=[',\n', ', ', ', '],
                                      mod=['!s', ''])
         return '{}(\n{}\n)'.format(constructor, indent_rows(inner_str))
Exemplo n.º 6
0
 def __repr__(self):
     """Return ``repr(self)``."""
     return '{!r}.element({})'.format(self.space,
                                      array1d_repr(self))
Exemplo n.º 7
0
 def __repr__(self):
     """Return ``repr(self)``."""
     return '{!r}.element({})'.format(self.space,
                                      array1d_repr(self))