Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tom Harke
pystencils
Commits
bb92b225
Commit
bb92b225
authored
Dec 04, 2016
by
Christian Godenschwager
Browse files
made Field's shape and strides members public
parent
3c74d1c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
field.py
View file @
bb92b225
...
...
@@ -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
@
property
def
spatialDimensions
(
self
):
...
...
@@ -109,7 +109,7 @@ class Field:
@
property
def
indexDimensions
(
self
):
return
len
(
self
.
_
shape
)
-
len
(
self
.
_layout
)
return
len
(
self
.
shape
)
-
len
(
self
.
_layout
)
@
property
def
layout
(
self
):
...
...
@@ -119,29 +119,21 @@ class Field:
def
name
(
self
):
return
self
.
_fieldName
@
property
def
shape
(
self
):
return
self
.
_shape
@
property
def
spatialShape
(
self
):
return
self
.
_
shape
[:
self
.
spatialDimensions
]
return
self
.
shape
[:
self
.
spatialDimensions
]
@
property
def
indexShape
(
self
):
return
self
.
_
shape
[
self
.
spatialDimensions
:]
return
self
.
shape
[
self
.
spatialDimensions
:]
@
property
def
spatialStrides
(
self
):
return
self
.
_
strides
[:
self
.
spatialDimensions
]
return
self
.
strides
[:
self
.
spatialDimensions
]
@
property
def
indexStrides
(
self
):
return
self
.
_strides
[
self
.
spatialDimensions
:]
@
property
def
strides
(
self
):
return
self
.
_strides
return
self
.
strides
[
self
.
spatialDimensions
:]
@
property
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
.
name
,
self
.
dtype
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment