예제 #1
0
def test_kernel():
    pytest.importorskip("pexpect")

    knl = MaximaKernel()
    knl.exec_str("k:1/(sqrt((x0-(a+t*b))^2+(y0-(c+t*d))^2+(z0-(e+t*f))^2))")
    knl.eval_str("sum(diff(k, t,deg)*t^deg,deg,0,6)")
    assert knl.eval_str("2+2").strip() == "4"
    knl.shutdown()
예제 #2
0
def _check_maxima():
    global MAXIMA_UNAVAILABLE

    import os
    executable = os.environ.get("PYMBOLIC_MAXIMA_EXECUTABLE", "maxima")

    try:
        knl = MaximaKernel(executable=executable)
        MAXIMA_UNAVAILABLE = False
        knl.shutdown()
    except (ImportError, RuntimeError):
        MAXIMA_UNAVAILABLE = True
예제 #3
0
def test_restart(knl):
    pytest.importorskip("pexpect")

    knl = MaximaKernel()
    knl.restart()
    knl.eval_str("1")
    knl.shutdown()
예제 #4
0
def test_kernel():
    pytest.importorskip("pexpect")

    knl = MaximaKernel()
    knl.exec_str("k:1/(sqrt((x0-(a+t*b))^2+(y0-(c+t*d))^2+(z0-(e+t*f))^2))")
    knl.eval_str("sum(diff(k, t,deg)*t^deg,deg,0,6)")
    assert knl.eval_str("2+2").strip() == "4"
    knl.shutdown()
예제 #5
0
def knl(request):
    knl = MaximaKernel()
    request.addfinalizer(knl.shutdown)
    return knl
예제 #6
0
def test_restart(knl):
    knl = MaximaKernel()
    knl.restart()
    knl.eval_str("1")
    knl.shutdown()
예제 #7
0
def knl(request):
    pytest.importorskip("pexpect")

    knl = MaximaKernel()
    request.addfinalizer(knl.shutdown)
    return knl