13 #include "../utils/runtime_error.h" 14 #include "../utils/pyargs_to_vec.h" 47 elem->check_required_keys(
"id");
53 auto &data = elem->get_data();
55 auto row_length = data.is_array() ? data.size() : 1;
59 map_key_to_row[key].resize(row_length);
64 for (
const auto &d : data.is_array() ? data : Json::array({data}))
68 map_key_to_row[key](irow) = d[key].get<double>();
92 if (row_length != trajectory.at(front_key).size())
107 array.row(irow++) = trajectory.at(key);
118 const py::args &args)
Vec< ShPtr< Generator > > generators
ProValueArray(const ElPtr &elem)
Constructor of ProValueArray class for one Element object.
ShPtr< Element > ElPtr
An alias for a shared pointer of Element class.
virtual void run_impl(const int index) override
Implementation of analysis using an element of generators.
Map< Str, ArrayXXd > results
const Map< Str, ArrayXXd > & get_results()
Get dictionary from keys for property to two-dimensional arrays of values for the property...
Vec< Map< Str, RowArrayXd > > value_trajectories
void pyargs_to_vec(const py::args &args, Vec< T > &vec)
Convert a py::args (a variable number arguments) object to a Vec object.
virtual void finish() override
Make results from value_trajectories.
std::vector< T > Vec
Vec is an alias for vector (same as list in Python).
void register_generator(const ShPtr< GEN > &gen)
void runtime_error(const Str &msg)
Raise (for Python) and throw (for C++) a runtime error.
This file has a definition of ProValueArray class, which is a subclass of Processor class...
virtual void prepare() override
Resize value_trajectories.
Namespace for utility functions.
void select(const py::args &args)
Specify string keys for properties. To use this object, at least one key must be specified. Note that new keys overwrite old keys.
std::unordered_map< T, U > Map
Map is an alias for unordered map (same as dict in Python).
void register_generators(const Vec< ShPtr< GEN >> &gens)
This file includes pybind11 and defines an alias for the namespace pybind11.