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
14986080
Commit
14986080
authored
1 year ago
by
Frederik Hennig
Browse files
Options
Downloads
Patches
Plain Diff
Change FieldShapeSymbol to only store a single field name
parent
a6924b47
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#64467
failed
1 year ago
Stage: pretest
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pystencils/field.py
+2
-2
2 additions, 2 deletions
src/pystencils/field.py
src/pystencils/sympyextensions/typed_sympy.py
+3
-3
3 additions, 3 deletions
src/pystencils/sympyextensions/typed_sympy.py
with
5 additions
and
5 deletions
src/pystencils/field.py
+
2
−
2
View file @
14986080
...
@@ -151,9 +151,9 @@ class Field:
...
@@ -151,9 +151,9 @@ class Field:
total_dimensions
=
spatial_dimensions
+
index_dimensions
total_dimensions
=
spatial_dimensions
+
index_dimensions
if
index_shape
is
None
or
len
(
index_shape
)
==
0
:
if
index_shape
is
None
or
len
(
index_shape
)
==
0
:
shape
=
tuple
([
FieldShapeSymbol
(
[
field_name
]
,
i
)
for
i
in
range
(
total_dimensions
)])
shape
=
tuple
([
FieldShapeSymbol
(
field_name
,
i
)
for
i
in
range
(
total_dimensions
)])
else
:
else
:
shape
=
tuple
([
FieldShapeSymbol
(
[
field_name
]
,
i
)
for
i
in
range
(
spatial_dimensions
)]
+
list
(
index_shape
))
shape
=
tuple
([
FieldShapeSymbol
(
field_name
,
i
)
for
i
in
range
(
spatial_dimensions
)]
+
list
(
index_shape
))
strides
=
tuple
([
FieldStrideSymbol
(
field_name
,
i
)
for
i
in
range
(
total_dimensions
)])
strides
=
tuple
([
FieldStrideSymbol
(
field_name
,
i
)
for
i
in
range
(
total_dimensions
)])
...
...
This diff is collapsed.
Click to expand it.
src/pystencils/sympyextensions/typed_sympy.py
+
3
−
3
View file @
14986080
...
@@ -106,7 +106,7 @@ class FieldStrideSymbol(TypedSymbol):
...
@@ -106,7 +106,7 @@ class FieldStrideSymbol(TypedSymbol):
obj
=
FieldStrideSymbol
.
__xnew_cached_
(
cls
,
*
args
,
**
kwds
)
obj
=
FieldStrideSymbol
.
__xnew_cached_
(
cls
,
*
args
,
**
kwds
)
return
obj
return
obj
def
__new_stage2__
(
cls
,
field_name
,
coordinate
):
def
__new_stage2__
(
cls
,
field_name
:
str
,
coordinate
:
int
):
from
..defaults
import
DEFAULTS
from
..defaults
import
DEFAULTS
name
=
f
"
_stride_
{
field_name
}
_
{
coordinate
}
"
name
=
f
"
_stride_
{
field_name
}
_
{
coordinate
}
"
...
@@ -139,7 +139,7 @@ class FieldShapeSymbol(TypedSymbol):
...
@@ -139,7 +139,7 @@ class FieldShapeSymbol(TypedSymbol):
obj
=
FieldShapeSymbol
.
__xnew_cached_
(
cls
,
*
args
,
**
kwds
)
obj
=
FieldShapeSymbol
.
__xnew_cached_
(
cls
,
*
args
,
**
kwds
)
return
obj
return
obj
def
__new_stage2__
(
cls
,
field_name
s
,
coordinate
):
def
__new_stage2__
(
cls
,
field_name
:
str
,
coordinate
:
int
):
from
..defaults
import
DEFAULTS
from
..defaults
import
DEFAULTS
names
=
"
_
"
.
join
([
field_name
for
field_name
in
field_names
])
names
=
"
_
"
.
join
([
field_name
for
field_name
in
field_names
])
...
@@ -147,7 +147,7 @@ class FieldShapeSymbol(TypedSymbol):
...
@@ -147,7 +147,7 @@ class FieldShapeSymbol(TypedSymbol):
obj
=
super
(
FieldShapeSymbol
,
cls
).
__xnew__
(
obj
=
super
(
FieldShapeSymbol
,
cls
).
__xnew__
(
cls
,
name
,
DEFAULTS
.
index_dtype
,
positive
=
True
cls
,
name
,
DEFAULTS
.
index_dtype
,
positive
=
True
)
)
obj
.
field_name
s
=
tuple
(
field_name
s
)
obj
.
field_name
=
field_name
obj
.
coordinate
=
coordinate
obj
.
coordinate
=
coordinate
return
obj
return
obj
...
...
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