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)
49 namespace py = pybind11;
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);
String serialization to describe an Attributable.
Definition: Attributable.hpp:212
void add_pickle(pybind11::class_< T_Args... > &cl, T_SeriesAccessor &&seriesAccessor)
Helper to Pickle Attributable Classes.
Definition: Pickle.hpp:47
Implementation for the root level of the openPMD hierarchy.
Definition: Series.hpp:186
Public definitions of openPMD-api.
std::string filePath() const
Reconstructs a path that can be passed to a Series constructor.
Definition: Attributable.cpp:175
std::vector< std::string > group
e.g., .bp, .h5, .json, ...
Definition: Attributable.hpp:224
Open Series as read-only, fails if Series is not found.