Skip to content

Convert symbolic relations to/from SymPy #23990

@rwst

Description

@rwst
sage: (x>0)._sympy_()
...
NotImplementedError: relation

Reversely in SymPy:

In [9]: x >= 0
Out[9]: x ≥ 0

In [10]: _._sage_()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-10-7149a2430cab> in <module>()
----> 1 _._sage_()

AttributeError: 'GreaterThan' object has no attribute '_sage_'

In [11]: Eq(x, 3)
Out[11]: x = 3

In [12]: _._sage_()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-12-7149a2430cab> in <module>()
----> 1 _._sage_()

AttributeError: 'Equality' object has no attribute '_sage_'

This functionality is needed both by #22322 and #23923. Needed is a fix to SympyConverter in expression-conversions.pyx

The reverse patch in SymPy is added here, see the PR sympy/sympy#13420

CC: @mforets

Component: interfaces

Author: Ralf Stephan

Branch/Commit: 479e206

Reviewer: Emmanuel Charpentier

Issue created by migration from https://trac.sagemath.org/ticket/23990

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions