Skip to content

Commit

Permalink
Fix Legacy Python MF API
Browse files Browse the repository at this point in the history
Keep ownership on the C++ side.
  • Loading branch information
ax3l committed Sep 25, 2024
1 parent 5329e3b commit eef40f3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Source/Python/WarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,15 @@ void init_WarpX (py::module& m)
throw std::runtime_error("MultiFab '" + internal_name + "' is unknown or is not allocated!");
}
},
py::arg("internal_name")
py::arg("internal_name"),
py::return_value_policy::reference_internal,
R"doc(Return a MultiFab by its internal name (deprecated).
The multifab('internal_name') signature is deprecated.
Please use:
- multifab('prefix', level=...) for scalar fields
- multifab('prefix', dir=..., level=...) for vector field components
where 'prefix' is the part of 'internal_name';' before the [])doc",
)
.def("multifab",
[](WarpX & wx, std::string scalar_name, int level) {
Expand Down

0 comments on commit eef40f3

Please sign in to comment.