Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small tweaks #217

Merged
merged 5 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions heyoka/expose_batch_integrators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,9 @@ void expose_batch_integrator_impl(py::module_ &m, const std::string &suffix)

// NOTE: GIL release is fine here even if the events contain
// Python objects, as the event vectors are moved in
// upon construction and thus we should never end up calling
// into the interpreter.
// upon construction and thus we never end up calling
// into the interpreter. Also, due to mandatory copy elision,
// we never end up making a copy of the return value.
py::gil_scoped_release release;

return hey::taylor_adaptive_batch<T>{std::move(sys),
Expand All @@ -184,8 +185,9 @@ void expose_batch_integrator_impl(py::module_ &m, const std::string &suffix)

// NOTE: GIL release is fine here even if the events contain
// Python objects, as the event vectors are moved in
// upon construction and thus we should never end up calling
// into the interpreter.
// upon construction and thus we never end up calling
// into the interpreter. Also, due to mandatory copy elision,
// we never end up making a copy of the return value.
py::gil_scoped_release release;

return hey::taylor_adaptive_batch<T>{std::move(sys),
Expand Down
5 changes: 3 additions & 2 deletions heyoka/expose_sgp4_propagators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ void expose_sgp4_propagator_impl(py::module_ &m, const std::string &suffix)
"sat_list"_a.noconvert(), "diff_order"_a.noconvert() = static_cast<std::uint32_t>(0),
HEYOKA_PY_CFUNC_ARGS(false), HEYOKA_PY_LLVM_STATE_ARGS,
docstrings::sgp4_propagator_init(std::same_as<T, double> ? "float" : "numpy.single").c_str());
// NOTE: this should be a static property, but at the moment doing this will mess up
// the documentation as sphinx will not pick up the docstring properly. Either we are
// doing something wrong in the docstring format or it is a genuine sphinx issue.
prop_cl.def_property_readonly(
"jdtype",
[](const prop_t &) -> py::object {
Expand Down Expand Up @@ -291,8 +294,6 @@ void expose_sgp4_propagator_impl(py::module_ &m, const std::string &suffix)
"__call__",
[](prop_t &prop, std::variant<py::array_t<T>, py::array_t<date_t>> tm_arr,
std::optional<py::array_t<T>> out) -> py::array_t<T> {
auto np = py::module_::import("numpy");

// NOTE: here we are repeating several checks which are redundant with
// checks already performed on the C++ side, with the goal of providing better
// error messages.
Expand Down
3 changes: 2 additions & 1 deletion heyoka/taylor_expose_integrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ void expose_taylor_integrator_impl(py::module &m, const std::string &suffix)
// NOTE: GIL release is fine here even if the events contain
// Python objects, as the event vectors are moved in
// upon construction and thus we should never end up calling
// into the interpreter.
// into the interpreter. Also, due to mandatory copy elision,
// we never end up making a copy of the return value.
py::gil_scoped_release release;

return std::visit(
Expand Down
Loading