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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
pystencils
Commits
fa4f153e
Commit
fa4f153e
authored
Feb 21, 2022
by
Jan Hönig
Browse files
Options
Downloads
Patches
Plain Diff
Reintroducting changes.
parent
cb42f2c0
No related branches found
No related tags found
1 merge request
!292
Rebase of pystencils Type System
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pystencils/astnodes.py
+0
-2
0 additions, 2 deletions
pystencils/astnodes.py
pystencils/transformations.py
+1
-1
1 addition, 1 deletion
pystencils/transformations.py
with
1 addition
and
3 deletions
pystencils/astnodes.py
+
0
−
2
View file @
fa4f153e
...
...
@@ -377,8 +377,6 @@ class Block(Node):
return
tmp
def
replace
(
self
,
child
,
replacements
):
if
self
.
_nodes
.
count
(
child
)
!=
1
:
print
(
'
here
'
)
assert
self
.
_nodes
.
count
(
child
)
==
1
idx
=
self
.
_nodes
.
index
(
child
)
del
self
.
_nodes
[
idx
]
...
...
This diff is collapsed.
Click to expand it.
pystencils/transformations.py
+
1
−
1
View file @
fa4f153e
...
...
@@ -773,7 +773,7 @@ def simplify_conditionals(node: ast.Node, loop_counter_simplification: bool = Fa
"""
for
conditional
in
node
.
atoms
(
ast
.
Conditional
):
# TODO simplify conditional before the type system! Casts make it very hard here
#
conditional.condition_expr = sp.simplify(conditional.condition_expr)
conditional
.
condition_expr
=
sp
.
simplify
(
conditional
.
condition_expr
)
if
conditional
.
condition_expr
==
sp
.
true
:
conditional
.
parent
.
replace
(
conditional
,
[
conditional
.
true_block
])
elif
conditional
.
condition_expr
==
sp
.
false
:
...
...
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
sign in
to comment