support Infty and NaN in has_symbol(...)#2105
Conversation
|
I'm not sure about this. |
|
Would you feel better with a has_basic(...) function and corresponding
visitor? (I'm trying to make symengine.py work more a drop-in replacement
for sympy since I'd like to use symengine more)
…On Mon, Jul 28, 2025, 21:23 Isuru Fernando ***@***.***> wrote:
*isuruf* left a comment (symengine/symengine#2105)
<#2105 (comment)>
I'm not sure about this. has_symbol is for symbolic variables, but infty
and nan are not symbolic variables.
—
Reply to this email directly, view it on GitHub
<#2105 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADWUMFMAOYLS4WRAQBNZ4L3KZ2CVAVCNFSM6AAAAACAT4WQVOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCMRYHA3TGOBSGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
What does SymPy do with has_symbol? |
|
You can take a look at the suggested tests in symengine/symengine.py#515 That behavior matches SymPy. But perhaps we should not use |
|
Yeah, |
|
I know, in this case, I need to check if a symbolic expression contains infinity. |
|
It looks like we already support infinity as a symbol, correct? If so, adding the support for checking it makes sense. How is the infinite symbol implemented exactly in SymEngine? That should guide us how to check for it. |
|
@certik, this is the definition: symengine/symengine/infinity.h Lines 20 to 22 in d1eb322 In this case, a "HasBasicVisitor" that allows matching for more Basic subclasses than only Symbol would be useful for me. If we want |
|
Yeah, a |
|
Alright, I will try to implement a HasBasicVisitor tomorrow (it's getting late here), and hopefully get back with a new PR soon. Thanks! |
|
Closing in favor of gh-2120 |
No description provided.