Skip to content

Commit

Permalink
explicit rv_policy copy
Browse files Browse the repository at this point in the history
  • Loading branch information
j-faria committed Jul 17, 2024
1 parent ad52117 commit 5bc2f90
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/kima/kepler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,8 @@ namespace brandt
else
{
// If cos(E) = -1, E = pi and tan(0.5*E) -> inf and f = E = pi
*sinf = 0;
*cosf = -1;
*sinf = 0.0;
*cosf = -1.0;
}
}

Expand Down Expand Up @@ -1190,7 +1190,9 @@ NB_MODULE(kepler, m) {
const double &P, const double &K, const double &ecc,
const double &w, const double &M0, const double &M0_epoch) {
size_t size = t.size();
auto v = brandt::keplerian(t, P, K, ecc, w, M0, M0_epoch);
std::vector<double> v = brandt::keplerian(t, P, K, ecc, w, M0, M0_epoch);

return nb::ndarray<nb::numpy, double>(v.data(), {size}, nb::handle());
}, "t"_a, "P"_a, "K"_a, "ecc"_a, "w"_a, "M0"_a, "M0_epoch"_a, KEPLERIAN_DOC);
}, "t"_a, "P"_a, "K"_a, "ecc"_a, "w"_a, "M0"_a, "M0_epoch"_a, KEPLERIAN_DOC,
nb::rv_policy::copy);
}

0 comments on commit 5bc2f90

Please sign in to comment.