-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not simplify in overloaded operators, type mappers #152
Conversation
c8e444f
to
4190844
Compare
4190844
to
e194173
Compare
0c76ffa
to
a787ba3
Compare
2c129f2
to
f41f938
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took a swift look over this and it looks good to me. Downstreams seem very upset with it though :(
They sure are. I'm trying to figure out whether the damage can be controlled or whether we need to do this in a more piecemeal fashion. |
f77d984
to
0d03277
Compare
0d03277
to
de7caf5
Compare
de7caf5
to
e355f08
Compare
diff --git a/pymbolic/geometric_algebra/__init__.py b/pymbolic/geometric_algebra/__init__.py
index fbc7e30..4291b74 100644
--- a/pymbolic/geometric_algebra/__init__.py
+++ b/pymbolic/geometric_algebra/__init__.py
@@ -526,6 +526,7 @@ class MultiVector(Generic[CoeffT]):
"""
space: Space
+ mapper_method = "map_multivector"
# {{{ construction
diff --git a/pymbolic/mapper/coefficient.py b/pymbolic/mapper/coefficient.py
index 99516f0..b09b4f6 100644
--- a/pymbolic/mapper/coefficient.py
+++ b/pymbolic/mapper/coefficient.py
@@ -100,6 +100,9 @@ class CoefficientCollector(Mapper):
return {1: expr}
def map_constant(self, expr):
+ if expr == 0:
+ return {}
+
return {1: expr}
def map_algebraic_leaf(self, expr):
EDIT: Well, that was wrong, there are other errors too :( |
e355f08
to
802b5aa
Compare
d776b9b
to
543e1b1
Compare
6964471
to
b4b87cb
Compare
Co-authored-by: Alexandru Fikl <[email protected]>
Co-authored-by: Alexandru Fikl <[email protected]>
c9dfd23
to
a48a937
Compare
a48a937
to
c76853d
Compare
Closes #11.
Closes #149.
What finally tipped the balance is that the overload-y operators are hard to precisely type, which made typing various downstream user packages unnecessarily hard.
loopycc @kaushikcfd