Skip to content
Snippets Groups Projects
Commit 699144dd authored by Michael Kuron's avatar Michael Kuron :mortar_board:
Browse files

Merge branch 'RemoveWarning' into 'master'

Remove gmpy workaround

See merge request !255
parents cb9cccfb 1e7a1e6f
No related branches found
No related tags found
No related merge requests found
"""Module to generate stencil kernels in C or CUDA using sympy expressions and call them as Python functions""" """Module to generate stencil kernels in C or CUDA using sympy expressions and call them as Python functions"""
from . import sympy_gmpy_bug_workaround # NOQA
from . import fd from . import fd
from . import stencil as stencil from . import stencil as stencil
from .assignment import Assignment, assignment_from_stencil from .assignment import Assignment, assignment_from_stencil
......
...@@ -4,6 +4,5 @@ import sympy as sp ...@@ -4,6 +4,5 @@ import sympy as sp
import pystencils as ps import pystencils as ps
import pystencils.jupyter import pystencils.jupyter
import pystencils.plot as plt import pystencils.plot as plt
import pystencils.sympy_gmpy_bug_workaround
__all__ = ['sp', 'np', 'ps', 'plt'] __all__ = ['sp', 'np', 'ps', 'plt']
# Disable gmpy backend until this bug is resolved if joblib serialize
# See https://github.com/sympy/sympy/pull/13530
import os
import warnings
os.environ['MPMATH_NOGMPY'] = '1'
try:
import mpmath.libmp
# In case the user has imported sympy first, then pystencils
if mpmath.libmp.BACKEND == 'gmpy':
warnings.warn("You are using the gmpy backend. You might encounter an error 'argument is not an mpz sympy'. "
"This is due to a known bug in sympy/gmpy library. "
"To prevent this, import pystencils first then sympy or set the environment variable "
"MPMATH_NOGMPY=1")
except ImportError:
pass
__all__ = []
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment