Skip to content

sympy.sympify atan2 throws an error #434

@3D-Whitestone

Description

@3D-Whitestone

I tried to use symengine in project where i need some atan2 functions. But every expression containing them couldn't be converted to sympy.
I use python version 3.11.0
Here is a small expample of the issue.

import sympy as sp
import symengine as se
print(sp.__name__, sp.__version__)
print(se.__name__, se.__version__)

x = se.Symbol("x")
y = se.Symbol("y")
z = sp.sympify(se.atan2(x,y))

This code throws the following error:

sympy 1.11.1
symengine 0.9.2
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[10], line 9
      7 x = se.Symbol("x")
      8 y = se.Symbol("y")
----> 9 z = sp.sympify(se.atan2(x,y))

File [c:\Users\marti\AppData\Local\Programs\Python\Python311\Lib\site-packages\sympy\core\sympify.py:445](file:///C:/Users/marti/AppData/Local/Programs/Python/Python311/Lib/site-packages/sympy/core/sympify.py:445), in sympify(a, locals, convert_xor, strict, rational, evaluate)
    443 for coerce in (float, int):
    444     try:
--> 445         return sympify(coerce(a))
    446     except (TypeError, ValueError, AttributeError, SympifyError):
    447         continue

File symengine_wrapper.pyx:1151, in symengine.lib.symengine_wrapper.Basic.__float__()

File symengine_wrapper.pyx:976, in symengine.lib.symengine_wrapper.Basic.n()

File symengine_wrapper.pyx:4346, in symengine.lib.symengine_wrapper.evalf()

RuntimeError: Symbol cannot be evaluated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions