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
9a8e6f9b
Commit
9a8e6f9b
authored
4 months ago
by
Richard Angersbach
Browse files
Options
Downloads
Patches
Plain Diff
Omit distinction between normal and reduced assignments in AssignmentCollection
parent
9741c024
No related branches found
No related tags found
1 merge request
!438
Reduction Support
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/pystencils/simp/assignment_collection.py
+0
-12
0 additions, 12 deletions
src/pystencils/simp/assignment_collection.py
with
0 additions
and
12 deletions
src/pystencils/simp/assignment_collection.py
+
0
−
12
View file @
9a8e6f9b
...
...
@@ -9,8 +9,6 @@ import pystencils
from
..assignment
import
Assignment
from
.simplifications
import
(
sort_assignments_topologically
,
transform_lhs_and_rhs
,
transform_rhs
)
from
..sympyextensions
import
count_operations
,
fast_subs
from
..sympyextensions
import
reduced_assign
from
..sympyextensions.reduction
import
ReducedAssignment
class
AssignmentCollection
:
...
...
@@ -58,13 +56,8 @@ class AssignmentCollection:
subexpressions
=
list
(
itertools
.
chain
.
from_iterable
(
[(
a
if
isinstance
(
a
,
Iterable
)
else
[
a
])
for
a
in
subexpressions
]))
# filter out reduced assignments
reduced_assignments
=
[
a
for
a
in
main_assignments
if
isinstance
(
a
,
ReducedAssignment
)]
main_assignments
=
[
a
for
a
in
main_assignments
if
(
a
not
in
reduced_assignments
)]
self
.
main_assignments
=
main_assignments
self
.
subexpressions
=
subexpressions
self
.
reductions
=
reduced_assignments
if
simplification_hints
is
None
:
simplification_hints
=
{}
...
...
@@ -79,11 +72,6 @@ class AssignmentCollection:
else
:
self
.
subexpression_symbol_generator
=
subexpression_symbol_generator
def
add_reduction
(
self
,
lhs
:
sp
.
Symbol
,
op
:
str
,
rhs
:
sp
.
Expr
)
->
None
:
"""
Adds an entry to the simplification_hints dictionary and checks that is does not exist yet.
"""
assert
lhs
not
in
self
.
reductions
,
f
"
Reduction for lhs
{
lhs
}
exists
"
self
.
reductions
.
append
(
reduced_assign
(
lhs
,
op
,
rhs
))
def
add_simplification_hint
(
self
,
key
:
str
,
value
:
Any
)
->
None
:
"""
Adds an entry to the simplification_hints dictionary and checks that is does not exist yet.
"""
assert
key
not
in
self
.
simplification_hints
,
"
This hint already exists
"
...
...
This diff is collapsed.
Click to expand it.
Frederik Hennig
@da15siwa
mentioned in commit
4e688b86
·
1 month ago
mentioned in commit
4e688b86
mentioned in commit 4e688b867339c90a6fba3ad12c383d1e59211ed9
Toggle commit list
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