Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephan Seitz
pystencils
Commits
a88cfc54
Commit
a88cfc54
authored
Sep 26, 2019
by
Stephan Seitz
Browse files
Eliminate usages of old name 'equation collection' for `AssignmentCollection`
parent
f1f2faee
Pipeline
#18411
passed with stage
in 3 minutes and 28 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pystencils/simp/assignment_collection.py
View file @
a88cfc54
...
...
@@ -16,12 +16,12 @@ class AssignmentCollection:
These simplification methods can change the subexpressions, but the number and
left hand side of the main equations themselves is not altered.
Additionally a dictionary of simplification hints is stored, which are set by the functions that create
equation
collections to transport information to the simplification system.
assignment
collections to transport information to the simplification system.
Attributes:
main_assignments: list of assignments
subexpressions: list of assignments defining subexpressions used in main equations
simplification_hints: dict that is used to annotate the
equation
collection with hints that are
simplification_hints: dict that is used to annotate the
assignment
collection with hints that are
used by the simplification system. See documentation of the simplification rules for
potentially required hints and their meaning.
subexpression_symbol_generator: generator for new symbols that are used when new subexpressions are added
...
...
@@ -344,7 +344,7 @@ class AssignmentCollection:
return
result
def
__repr__
(
self
):
return
"
Equation
Collection for "
+
","
.
join
([
str
(
eq
.
lhs
)
for
eq
in
self
.
main_assignments
])
return
"
Assignment
Collection for "
+
","
.
join
([
str
(
eq
.
lhs
)
for
eq
in
self
.
main_assignments
])
def
__str__
(
self
):
result
=
"Subexpressions:
\n
"
...
...
pystencils/simp/simplifications.py
View file @
a88cfc54
...
...
@@ -30,10 +30,10 @@ def sort_assignments_topologically(assignments: Sequence[Union[Assignment, Node]
def
sympy_cse
(
ac
):
"""Searches for common subexpressions inside the
equation
collection.
"""Searches for common subexpressions inside the
assignment
collection.
Searches is done in both the existing subexpressions as well as the assignments themselves.
It uses the sympy subexpression detection to do this. Return a new
equation
collection
It uses the sympy subexpression detection to do this. Return a new
assignment
collection
with the additional subexpressions found
"""
symbol_gen
=
ac
.
subexpression_symbol_generator
...
...
pystencils/simp/simplificationstrategy.py
View file @
a88cfc54
...
...
@@ -9,8 +9,8 @@ from pystencils.simp.assignment_collection import AssignmentCollection
class
SimplificationStrategy
:
"""A simplification strategy is an ordered collection of simplification rules.
Each simplification is a function taking an
equation
collection, and returning a new simplified
equation
collection. The strategy can nicely print intermediate simplification stages and results
Each simplification is a function taking an
assignment
collection, and returning a new simplified
assignment
collection. The strategy can nicely print intermediate simplification stages and results
to Jupyter notebooks.
"""
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment