Skip to content

Commit c6f95e3

Browse files
committed
Revert adaptions to flint.types.nmod.nmod
Following the explanation in sympy/sympy#26645 (comment)
1 parent 1618a86 commit c6f95e3

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

symengine/lib/symengine_wrapper.in.pyx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ try:
3131
except ImportError:
3232
have_numpy = False
3333

34-
try:
35-
import flint as _flint
36-
have_flint_py = True
37-
except ImportError:
38-
_flint = None
39-
have_flint_py = False
40-
4134

4235
class SympifyError(Exception):
4336
pass
@@ -506,17 +499,6 @@ def sympy2symengine(a, raise_error=False):
506499
elif isinstance(a, sympy.ConditionSet):
507500
return conditionset(*(a.args))
508501

509-
if have_flint_py:
510-
if isinstance(a, _flint.types.nmod.nmod):
511-
# Work around for sympy/sympy#26645
512-
class _modular_integer(sympy.polys.domains.modularinteger.ModularInteger):
513-
mod = int(a.modulus())
514-
dom = sympy.polys.domains.ZZ
515-
sym = True
516-
517-
b = _modular_integer(int(a))
518-
return PyNumber(b, sympy_module)
519-
520502
if raise_error:
521503
raise SympifyError(("sympy2symengine: Cannot convert '%r' (of type %s)"
522504
" to a symengine type.") % (a, type(a)))

symengine/tests/test_sympy_conv.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,6 @@ def test_pynumber():
778778
assert isinstance(b, PyNumber)
779779
assert b == a # Check equality via SymEngine
780780
assert a == b # Check equality via SymPy
781-
assert (b-a).simplify() == 0
782781
assert str(a) == str(b)
783782

784783
a = 1 - a

0 commit comments

Comments
 (0)