Skip to content

Commit

Permalink
Print IntVect values in repr (#380)
Browse files Browse the repository at this point in the history
This does what the title says. Note that the RealVect already does this.
  • Loading branch information
dpgrote authored Oct 12, 2024
1 parent c0166ac commit fdd9c8c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Base/IntVect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ namespace
py::class_< iv_type > py_iv(m, iv_name.c_str());
py_iv
.def("__repr__",
[iv_name](const iv_type&) {
return "<amrex." + iv_name + ">";
[iv_name](const iv_type& iv) {
std::stringstream s;
s << iv;
return "<amrex." + iv_name + s.str() + ">";
}
)
.def("__str",
Expand Down

0 comments on commit fdd9c8c

Please sign in to comment.