Commit bb92b225 authored by Christian Godenschwager's avatar Christian Godenschwager
Browse files

made Field's shape and strides members public

parent 3c74d1c3
......@@ -100,8 +100,8 @@ class Field:
self._fieldName = fieldName
self._dtype = numpyDataTypeToC(dtype)
self._layout = layout
self._shape = shape
self._strides = strides
self.shape = shape
self.strides = strides
def spatialDimensions(self):
......@@ -109,7 +109,7 @@ class Field:
def indexDimensions(self):
return len(self._shape) - len(self._layout)
return len(self.shape) - len(self._layout)
def layout(self):
......@@ -119,29 +119,21 @@ class Field:
def name(self):
return self._fieldName
def shape(self):
return self._shape
def spatialShape(self):
return self._shape[:self.spatialDimensions]
return self.shape[:self.spatialDimensions]
def indexShape(self):
return self._shape[self.spatialDimensions:]
return self.shape[self.spatialDimensions:]
def spatialStrides(self):
return self._strides[:self.spatialDimensions]
return self.strides[:self.spatialDimensions]
def indexStrides(self):
return self._strides[self.spatialDimensions:]
def strides(self):
return self._strides
return self.strides[self.spatialDimensions:]
def dtype(self):
......@@ -172,7 +164,7 @@ class Field:
return Field.Access(self, center)(*args, **kwargs)
def __hash__(self):
return hash((self._layout, self._shape, self._strides, self._dtype, self._fieldName))
return hash((self._layout, self.shape, self.strides, self._dtype, self._fieldName))
def __eq__(self, other):
selfTuple = (self.shape, self.strides,, self.dtype)
Supports Markdown
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