Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
pystencils
Commits
b68e174e
Commit
b68e174e
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
Make Field.Access a TypedSymbol
parent
c06f8b77
No related branches found
No related tags found
1 merge request
!14
Remove floor, ceiling for integer symbols
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pystencils/field.py
+3
-3
3 additions, 3 deletions
pystencils/field.py
with
3 additions
and
3 deletions
pystencils/field.py
+
3
−
3
View file @
b68e174e
...
@@ -10,7 +10,7 @@ import sympy as sp
...
@@ -10,7 +10,7 @@ import sympy as sp
from
sympy.core.cache
import
cacheit
from
sympy.core.cache
import
cacheit
from
pystencils.alignedarray
import
aligned_empty
from
pystencils.alignedarray
import
aligned_empty
from
pystencils.data_types
import
StructType
,
create_type
from
pystencils.data_types
import
StructType
,
TypedSymbol
,
create_type
from
pystencils.kernelparameters
import
FieldShapeSymbol
,
FieldStrideSymbol
from
pystencils.kernelparameters
import
FieldShapeSymbol
,
FieldStrideSymbol
from
pystencils.stencil
import
direction_string_to_offset
,
offset_to_direction_string
from
pystencils.stencil
import
direction_string_to_offset
,
offset_to_direction_string
from
pystencils.sympyextensions
import
is_integer_sequence
from
pystencils.sympyextensions
import
is_integer_sequence
...
@@ -410,7 +410,7 @@ class Field(AbstractField):
...
@@ -410,7 +410,7 @@ class Field(AbstractField):
return
self
.
hashable_contents
()
==
other
.
hashable_contents
()
return
self
.
hashable_contents
()
==
other
.
hashable_contents
()
# noinspection PyAttributeOutsideInit,PyUnresolvedReferences
# noinspection PyAttributeOutsideInit,PyUnresolvedReferences
class
Access
(
sp
.
Symbol
,
AbstractField
.
AbstractAccess
):
class
Access
(
Typed
Symbol
,
AbstractField
.
AbstractAccess
):
"""
Class representing a relative access into a `Field`.
"""
Class representing a relative access into a `Field`.
This class behaves like a normal sympy Symbol, it is actually derived from it. One can built up
This class behaves like a normal sympy Symbol, it is actually derived from it. One can built up
...
@@ -462,7 +462,7 @@ class Field(AbstractField):
...
@@ -462,7 +462,7 @@ class Field(AbstractField):
if
superscript
is
not
None
:
if
superscript
is
not
None
:
symbol_name
+=
"
^
"
+
superscript
symbol_name
+=
"
^
"
+
superscript
obj
=
super
(
Field
.
Access
,
self
).
__xnew__
(
self
,
symbol_name
)
obj
=
super
(
Field
.
Access
,
self
).
__xnew__
(
self
,
symbol_name
,
field
.
dtype
)
obj
.
_field
=
field
obj
.
_field
=
field
obj
.
_offsets
=
[]
obj
.
_offsets
=
[]
for
o
in
offsets
:
for
o
in
offsets
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment