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
4c225c82
Commit
4c225c82
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
Add AssignmentCollection.{free_fields,bound_fields}
parent
0a8c16b0
No related branches found
No related tags found
1 merge request
!57
Add AssignmentCollection.{free_fields,bound_fields}
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pystencils/simp/assignment_collection.py
+9
-0
9 additions, 0 deletions
pystencils/simp/assignment_collection.py
with
9 additions
and
0 deletions
pystencils/simp/assignment_collection.py
+
9
−
0
View file @
4c225c82
...
@@ -111,6 +111,15 @@ class AssignmentCollection:
...
@@ -111,6 +111,15 @@ class AssignmentCollection:
"
Not in SSA form - same symbol assigned multiple times
"
"
Not in SSA form - same symbol assigned multiple times
"
return
bound_symbols_set
return
bound_symbols_set
def
free_fields
(
self
):
"""
All fields accessed in the assignment collection, which do not occur as left hand sides in any assignment.
"""
return
{
s
.
field
for
s
in
self
.
free_symbols
if
hasattr
(
s
,
'
field
'
)}
@property
def
bound_fields
(
self
):
"""
All field accessed on the left hand side of a main assignment or a subexpression.
"""
return
{
s
.
field
for
s
in
self
.
bound_symbols
if
hasattr
(
s
,
'
field
'
)}
@property
@property
def
defined_symbols
(
self
)
->
Set
[
sp
.
Symbol
]:
def
defined_symbols
(
self
)
->
Set
[
sp
.
Symbol
]:
"""
All symbols which occur as left-hand-sides of one of the main equations
"""
"""
All symbols which occur as left-hand-sides of one of the main equations
"""
...
...
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