23 #include "openPMD/backend/Attributable.hpp" 24 #include "openPMD/IO/Access.hpp" 25 #include "openPMD/Series.hpp" 27 #include <pybind11/pybind11.h> 28 #include <pybind11/stl.h> 46 template<
typename... T_Args,
typename T_SeriesAccessor >
49 pybind11::class_< T_Args... > & cl,
50 T_SeriesAccessor && seriesAccessor
56 using PickledClass =
typename std::tuple_element<
58 std::tuple< T_Args... >
63 [](
const PickledClass &a ) {
70 [&seriesAccessor]( py::tuple t ) {
73 throw std::runtime_error(
"Invalid state!");
75 std::string
const filename = t[0].cast< std::string >();
76 std::vector< std::string >
const group =
77 t[1].cast< std::vector< std::string > >();
87 return seriesAccessor( series, group );
Definition: Variant.hpp:33
std::string filePath() const
Reconstructs a path that can be passed to a Series constructor.
Definition: Attributable.cpp:187
void add_pickle(pybind11::class_< T_Args... > &cl, T_SeriesAccessor &&seriesAccessor)
Helper to Pickle Attributable Classes.
Definition: Pickle.hpp:48
Root level of the openPMD hierarchy.
Definition: Series.hpp:476
Public definitions of openPMD-api.
Definition: Date.cpp:29
std::vector< std::string > group
e.g., .bp, .h5, .json, ...
Definition: Attributable.hpp:242
String serialization to describe an Attributable.
Definition: Attributable.hpp:230
open series as read-only, fails if series is not found