You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kick out py_shared_ptr and instead keep the python instance alive manually by holding a reference to it
See pybind/pybind11#1389 for why py_shared_ptr was needed in the first place, and the comment from May 27 why we may not want to use it (reference cycle)
Interpolates a (vector valued) function on a uniform grid.
69
68
This interpolant is optimized for fast function evaluation (at the cost of memory usage). The main purpose of this class is to be used to interpolate magnetic fields and then use the interpolant for tasks such as fieldline or particle tracing for which the field needs to be evaluated many many times.
.def("evaluate_batch", &RegularGridInterpolant3D<PyTensor>::evaluate_batch, "Evaluate the interpolant at multiple points (faster than `evaluate` as it uses prefetching).");
75
74
76
75
77
-
py::class_<Current<PyArray>, py_shared_ptr<Current<PyArray>>>(m, "Current", "Simple class that wraps around a single double representing a coil current.")
76
+
py::class_<Current<PyArray>, shared_ptr<Current<PyArray>>>(m, "Current", "Simple class that wraps around a single double representing a coil current.")
78
77
.def(py::init<double>())
79
78
.def("set_dofs", &Current<PyArray>::set_dofs, "Set the current.")
80
79
.def("get_dofs", &Current<PyArray>::get_dofs, "Get the current.")
81
80
.def("set_value", &Current<PyArray>::set_value, "Set the current.")
82
81
.def("get_value", &Current<PyArray>::get_value, "Get the current.");
83
82
84
83
85
-
py::class_<Coil<PyArray>, py_shared_ptr<Coil<PyArray>>>(m, "Coil", "Optimizable that represents a coil, consisting of a curve and a current.")
84
+
py::class_<Coil<PyArray>, shared_ptr<Coil<PyArray>>>(m, "Coil", "Optimizable that represents a coil, consisting of a curve and a current.")
.def_readonly("curve", &Coil<PyArray>::curve, "Get the underlying curve.")
88
87
.def_readonly("current", &Coil<PyArray>::current, "Get the underlying current.");
89
88
90
-
auto mf = py::class_<PyMagneticField, PyMagneticFieldTrampoline<PyMagneticField>, py_shared_ptr<PyMagneticField>>(m, "MagneticField", "Abstract class representing magnetic fields.")
89
+
auto mf = py::class_<PyMagneticField, PyMagneticFieldTrampoline<PyMagneticField>, shared_ptr<PyMagneticField>>(m, "MagneticField", "Abstract class representing magnetic fields.")
0 commit comments