-
Notifications
You must be signed in to change notification settings - Fork 156
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
Implementing Symbolic Has Query Method #2336
Conversation
But now, I don't think we have the |
It's implemented here: https://github.com/symengine/symengine/blob/6da98cf4527802c8c98ddc696dfd2999765cda1b/symengine/visitor.h#L129, can you send a PR to SymEngine to expose it via |
Also a test needs to be added. |
Sure I could look into it ! |
Once conda-forge/symengine-feedstock#38 is merged, then just apply the following patch: diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml
index 50e03768c..901c609d2 100644
--- a/.github/workflows/CI.yml
+++ b/.github/workflows/CI.yml
@@ -400,7 +400,7 @@ jobs:
create-args: >-
python=3.10
bison=3.4
- symengine=0.9.0
+ symengine=0.11.1
sympy=1.11.1
- uses: hendrikmuhs/ccache-action@main And that should allow you to use the new Also add a test for this in this PR. |
SymEngine was updated in #2346. @anutosh491 go ahead and use the new |
I think so all query functions in sympy return
So you could let me know what we should be returning through our query methods. We should be able to tweak this if we want a bool value through the symbolic pass and replicate something like
edit1 : I'll make some changes which would make the query method return a bool value. We can change it later if we like. |
Now that |
I think so this should be it. The Pr introduces a method called
Now if we have any new attribute we would just need to register it here in the |
Excellent, I will review carefully later today. |
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.
I think that this is good, thanks for the PR!
Thanks for the reviews on this one. |
Something to make note of
*args
and then checks for their presence through a for loop. Hence something like the following worksPresence of any argument (in the above case
x
would returnTrue
). But currently, I don't think we are supporting any instrinsic function that takes in parameters through*args
( we obviously have intrinsic array functions but sympy's has method doesn't work on containers as it should)After some thought, I can see that atleast for our case which is to implement the mrv set, we won't need to feed multiple arguments to the has query ( we just need
e.has(x)
), hence as of now I've added support through the symbolic binary macro.