Skip to content
Snippets Groups Projects

Change `Field.__repr__` to match representation in `pystencils.fields`

Merged Stephan Seitz requested to merge seitz/pystencils:Field.__repr__ into master
+ 6
1
@@ -392,7 +392,12 @@ class Field(AbstractField):
return self.dtype.numpy_dtype.itemsize
def __repr__(self):
return self._field_name
if self.index_shape:
return f'{self._field_name}({",".join(str(i) for i in self.index_shape)}): ' \
f'{str(self.dtype)}[{",".join(str(i) for i in self.spatial_shape)}])'
else:
return f'{self._field_name}: ' \
f'{str(self.dtype)}[{",".join(str(i) for i in self.spatial_shape)}])'
def neighbor(self, coord_id, offset):
offset_list = [0] * self.spatial_dimensions
Loading