Commit 699144dd authored by Michael Kuron's avatar Michael Kuron
Browse files

Merge branch 'RemoveWarning' into 'master'

Remove gmpy workaround

See merge request pycodegen/pystencils!255
parents cb9cccfb 1e7a1e6f
Pipeline #33035 failed with stage
in 23 minutes and 33 seconds
"""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 stencil as stencil
from .assignment import Assignment, assignment_from_stencil
......@@ -4,6 +4,5 @@ import sympy as sp
import pystencils as ps
import pystencils.jupyter
import pystencils.plot as plt
import pystencils.sympy_gmpy_bug_workaround
__all__ = ['sp', 'np', 'ps', 'plt']
# Disable gmpy backend until this bug is resolved if joblib serialize
# See
import os
import warnings
os.environ['MPMATH_NOGMPY'] = '1'
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 "
except ImportError:
__all__ = []
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment