Commit a278f336 authored by Martin Bauer's avatar Martin Bauer
Browse files

Bugfix in new_field_with_different_name

-> different fields need different shape/stride symbols
parent 604bc7c0
......@@ -292,7 +292,11 @@ class Field(AbstractField):
self.latex_name = None # type: Optional[str]
def new_field_with_different_name(self, new_name):
return Field(new_name, self.field_type, self._dtype, self._layout, self.shape, self.strides)
if self.has_fixed_shape:
return Field(new_name, self.field_type, self._dtype, self._layout, self.shape, self.strides)
else:
return Field.create_generic(new_name, self.spatial_dimensions, self.dtype.numpy_dtype,
self.index_dimensions, self._layout, self.index_shape, self.field_type)
@property
def spatial_dimensions(self) -> int:
......
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