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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Sebastian Bindgen
pystencils
Commits
fe94402a
Commit
fe94402a
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
Bugfix: count field as accessed even if through InterpolatorAccess instead of ResolvedFieldAccess
parent
0ff425f3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pystencils/astnodes.py
+5
-4
5 additions, 4 deletions
pystencils/astnodes.py
with
5 additions
and
4 deletions
pystencils/astnodes.py
+
5
−
4
View file @
fe94402a
...
...
@@ -211,17 +211,18 @@ class KernelFunction(Node):
return
self
.
_body
,
@property
def
fields_accessed
(
self
)
->
Set
[
'
ResolvedFieldAccess
'
]:
def
fields_accessed
(
self
)
->
Set
[
Field
]:
"""
Set of Field instances: fields which are accessed inside this kernel function
"""
return
set
(
o
.
field
for
o
in
self
.
atoms
(
ResolvedFieldAccess
))
from
pystencils.interpolation_astnodes
import
InterpolatorAccess
return
set
(
o
.
field
for
o
in
itertools
.
chain
(
self
.
atoms
(
ResolvedFieldAccess
),
self
.
atoms
(
InterpolatorAccess
)))
@property
def
fields_written
(
self
)
->
Set
[
'
ResolvedFieldAccess
'
]:
def
fields_written
(
self
)
->
Set
[
Field
]:
assignments
=
self
.
atoms
(
SympyAssignment
)
return
{
a
.
lhs
.
field
for
a
in
assignments
if
isinstance
(
a
.
lhs
,
ResolvedFieldAccess
)}
@property
def
fields_read
(
self
)
->
Set
[
'
ResolvedFieldAccess
'
]:
def
fields_read
(
self
)
->
Set
[
Field
]:
assignments
=
self
.
atoms
(
SympyAssignment
)
return
set
().
union
(
itertools
.
chain
.
from_iterable
([
f
.
field
for
f
in
a
.
rhs
.
free_symbols
if
hasattr
(
f
,
'
field
'
)]
for
a
in
assignments
))
...
...
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