23 #include "openPMD/IO/Access.hpp" 24 #include "openPMD/Series.hpp" 25 #include "openPMD/backend/Attributable.hpp" 27 #include <pybind11/pybind11.h> 28 #include <pybind11/stl.h> 45 template <
typename... T_Args,
typename T_SeriesAccessor>
47 add_pickle(pybind11::class_<T_Args...> &cl, T_SeriesAccessor &&seriesAccessor)
53 typename std::tuple_element<0, std::tuple<T_Args...> >::type;
57 [](
const PickledClass &a) {
64 [&seriesAccessor](py::tuple t) {
67 throw std::runtime_error(
"Invalid state!");
69 std::string
const filename = t[0].cast<std::string>();
70 std::vector<std::string>
const group =
71 t[1].cast<std::vector<std::string> >();
78 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:179
void add_pickle(pybind11::class_< T_Args... > &cl, T_SeriesAccessor &&seriesAccessor)
Helper to Pickle Attributable Classes.
Definition: Pickle.hpp:47
Root level of the openPMD hierarchy.
Definition: Series.hpp:537
Public definitions of openPMD-api.
Definition: Date.cpp:28
String serialization to describe an Attributable.
Definition: Attributable.hpp:241
std::vector< std::string > group
e.g., .bp, .h5, .json, ...
Definition: Attributable.hpp:253
open series as read-only, fails if series is not found