-
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
Implemented query method for log class #2384
Implemented query method for log class #2384
Conversation
My initial thought process here was that rather than extracting args and then extracting the first element from the list, we can expose a |
I would not allow |
Let's add a Python/SymPy test for "Log". |
Ohh wait but can't you do something like the following is sympy
Hence I thought I wouldn't be a bad idea to introduce |
We will always support just a subset. So you can also do |
Ohh ok yes that makes sense to me and we only try implementing the approach you are talking about. I have also fixed |
I think this would be ready now. |
Awesome, thanks! |
I think we need to use
Secondly the
So what I see here is we need a |
You can introduce We need to support |
Actually I am somewhat confused. We still plan to maintain consistency with sympy right ? (Atleast we've done that for all tests till now which means the tests through sympy or lpython return the same result). But consider the following.
We would be returning
Because through sympy we have the following
What comes in my mind here is that users could still use lpython/src/lpython/semantics/python_ast_to_asr.cpp Lines 6040 to 6046 in f8fbd8d
But to begin with shouldn't we still start with y.func == exp to maintain consistency ?
|
But yeah, correct I think we might need indexing through args nonetheless as I can see at some places in CASE 1
CASE 2
Atleast in |
The rule is that if LPython compiles it, then SymPy must as well. But not vice versa. I didn't realize that |
Yes correct. So to begin with we need to start with something like |
I would get Then, we can add special handling for |
Actually I am not fully sure of how would can we represent this ( What does make sense to me is something like this
I think representing EDIT: Ohh wait, actually I forgot we had |
I would implement it using the design at #2393. |
There's a TODO in this Pr which I need to address
So technically there is no
SYMENGINE_EXP
class which means to implement something likee.func == exp
, we first need to check ife.func == Pow and e.base == E
.The first part here is easy but for the second part we need to use the
basic_get_args
which is defined as the following in sympy.It takes a pointer to an empty container I think and then populate it with the arguments. So basically we want the populated list and then the first element of that list would be our
base
.Now the point is we shall pass a
CPtr
variablee
as the first argument but I am not sure what would suffice forCVecBasic *args
. I don't think apointer
toList[CPtr]
works here so need to ideate on that.