def test_sympy_interaction():
    pytest.importorskip('sympy')
    import sympy as sp
    (x, y) = sp.symbols('x y')
    f = sp.Function('f')
    s1_expr = (1 / f((x / sp.sqrt(((x ** 2) + (y ** 2))))).diff(x, 5))
    from pymbolic.interop.sympy import SympyToPymbolicMapper, PymbolicToSympyMapper
    s2p = SympyToPymbolicMapper()
    p2s = PymbolicToSympyMapper()
    p1_expr = s2p(s1_expr)
    s2_expr = p2s(p1_expr)
    assert (sp.ratsimp((s1_expr - s2_expr)) == 0)
    p2_expr = s2p(s2_expr)
    s3_expr = p2s(p2_expr)
    assert (sp.ratsimp((s1_expr - s3_expr)) == 0)
def test_sympy_interaction():
    pytest.importorskip('sympy')
    import sympy as sp
    (x, y) = sp.symbols('x y')
    f = sp.Function('f')
    s1_expr = (1 / f((x / sp.sqrt(((x ** 2) + (y ** 2))))).diff(x, 5))
    from pymbolic.interop.sympy import SympyToPymbolicMapper, PymbolicToSympyMapper
    s2p = SympyToPymbolicMapper()
    p2s = PymbolicToSympyMapper()
    p1_expr = s2p(s1_expr)
    s2_expr = p2s(p1_expr)
    assert (sp.ratsimp((s1_expr - s2_expr)) == 0)
    p2_expr = s2p(s2_expr)
    s3_expr = p2s(p2_expr)
    assert (sp.ratsimp((s1_expr - s3_expr)) == 0)