Skip to content

Commit

Permalink
Python: Warn old warpx.multifab Signature
Browse files Browse the repository at this point in the history
Warn users that use the old `warpx.multifab("internal_name")` overload
to use the new one that only requests a prefix, with dir and level as
extra arguments.
  • Loading branch information
ax3l committed Sep 25, 2024
1 parent 5329e3b commit 2656833
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Source/Python/WarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ void init_WarpX (py::module& m)
)
.def("multifab",
[](WarpX & wx, std::string internal_name) {
py::print("WARNING: WarpX' multifab('internal_name') signature is deprecated.\nPlease use:\n"
"- multifab('prefix', level=...) for scalar fields\n"
"- multifab('prefix', dir=..., level=...) for vector field components\n"
"where 'prefix' is the part of 'internal_name';' before the []",
py::arg("file") = py::module_::import("sys").attr("stderr"));
if (wx.m_fields.internal_has(internal_name)) {
return wx.m_fields.internal_get(internal_name);
} else {
Expand Down

0 comments on commit 2656833

Please sign in to comment.