![]() |
Shamrock 2025.10.0
Astrophysical Code
|
Lazily fetches a single named field of a patch as a numpy array, on demand. More...
#include <shampylib/include/shampylib/PatchDataToPy.hpp>
Public Member Functions | |
| PatchDataLazyGetter (shamrock::patch::PatchDataLayer &pdat) | |
| py::object | get_item (const std::string &key) const |
Public Attributes | |
| shamrock::patch::PatchDataLayer & | pdat |
Lazily fetches a single named field of a patch as a numpy array, on demand.
Unlike pdat_to_dic (which eagerly copies every field of a patch to a python dict), this only pays the device->host copy cost for the fields actually queried via operator[]/__getitem__, so a getter that only touches a handful of fields does not force a copy of every field in the patch.
Definition at line 279 of file PatchDataToPy.hpp.
|
inlineexplicit |
Definition at line 283 of file PatchDataToPy.hpp.
|
inline |
Definition at line 285 of file PatchDataToPy.hpp.
| shamrock::patch::PatchDataLayer& shamrock::PatchDataLazyGetter::pdat |
Definition at line 281 of file PatchDataToPy.hpp.