Skip to content

Commit

Permalink
Remove references to tpoly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco Biscani authored and Francesco Biscani committed Sep 2, 2023
1 parent ea247f3 commit 9651301
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 28 deletions.
1 change: 0 additions & 1 deletion heyoka/_sympy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ def mul_wrapper(*args):

retval[_spy.Function("heyoka_kepE")] = core.kepE
retval[_spy.Function("heyoka_time")] = lambda: core.time
retval[_spy.Function("heyoka_tpoly")] = core.tpoly

return retval

Expand Down
4 changes: 2 additions & 2 deletions heyoka/_test_mp.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,17 @@ def test_add_jet(self):
taylor_add_jet,
sin,
par,
tpoly,
make_vars,
real,
time,
taylor_adaptive,
core,
)
import numpy as np

x, v = make_vars("x", "v")

sys = [(x, v), (v, -par[0] * sin(x) + tpoly(par[1], par[6]))]
sys = [(x, v), (v, -par[0] * sin(x) + time * (par[1] + par[6]))]

prec = 237

Expand Down
3 changes: 0 additions & 3 deletions heyoka/expose_expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,6 @@ void expose_expression(py::module_ &m)
// pi.
m.attr("pi") = hey::pi;

// tpoly().
m.def("tpoly", &hey::tpoly);

// Diff.
m.def(
"diff",
Expand Down
5 changes: 0 additions & 5 deletions heyoka/setup_sympy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,6 @@ void setup_sympy(py::module &m)
auto sympy_time = py::object(detail::spy->attr("Function")("heyoka_time"));
detail::fmap[typeid(hy::detail::time_impl)] = sympy_time;

// tpoly.
// NOTE: this will remain an unevaluated binary function.
auto sympy_tpoly = py::object(detail::spy->attr("Function")("heyoka_tpoly"));
detail::fmap[typeid(hy::detail::tpoly_impl)] = sympy_tpoly;

// Constants.
detail::fmap[typeid(hy::constant)] = [](std::unordered_map<const void *, py::object> &, const hy::func &f) {
const auto *cptr = f.extract<hy::constant>();
Expand Down
18 changes: 1 addition & 17 deletions heyoka/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def test_basic(self):
par,
time,
taylor_adaptive_batch,
tpoly,
core,
)
from .core import _ppc_arch
Expand All @@ -82,7 +81,7 @@ def test_basic(self):
sys = [(x, v), (v, -9.8 * sin(x))]
sys_par = [(x, v), (v, -par[0] * sin(x))]
sys_par_t = [(x, v), (v, -par[0] * sin(x) + time)]
sys_par_t2 = [(x, v), (v, -par[0] * sin(x) + tpoly(par[1], par[6]))]
sys_par_t2 = [(x, v), (v, -par[0] * sin(x) + time * (par[1] + par[6]))]

if _ppc_arch:
fp_types = [float]
Expand Down Expand Up @@ -2105,21 +2104,6 @@ def test_func_conversion(self):
self.assertEqual(core.time, from_sympy(spy.Function("heyoka_time")()))
self.assertEqual(to_sympy(core.time), spy.Function("heyoka_time")())

self.assertEqual(
core.tpoly(core.par[0], core.par[10]),
from_sympy(
spy.Function("heyoka_tpoly")(
spy.Symbol("par[0]"), spy.Symbol("par[10]")
)
),
)
self.assertEqual(
to_sympy(core.tpoly(core.par[0], core.par[10])),
spy.Function("heyoka_tpoly")(
spy.Symbol("par[0]", real=True), spy.Symbol("par[10]", real=True)
),
)

with self.assertRaises(TypeError) as cm:
from_sympy(abs(x))
self.assertTrue("Unable to convert the sympy object" in str(cm.exception))
Expand Down

0 comments on commit 9651301

Please sign in to comment.