4 #include <boost/property_tree/json_parser.hpp> 10 int s = wordexp(path.c_str(), &
p, WRDE_NOCMD | WRDE_SHOWERR);
12 if ((s != 0) || (p.we_wordc != 1)) {
30 scalarInputKeys(scalarInputKeys),
31 vectorInputKeys(vectorInputKeys),
32 outputKeys(outputKeys)
55 throw std::runtime_error(
56 "Failed to parse config file: " + configPath +
". : " + e.what()
68 std::vector<std::string> varNames;
70 for (
auto &stree : tree.get_child(keys.
varNames)) {
71 varNames.push_back(stree.second.get_value<
std::string>());
80 pt::read_json(fname, tree);
std::string getConfigPath() const
std::vector< std::string > outputKeys
std::vector< InputConfigKeys > scalarInputKeys
std::vector< std::string > outputNodes
std::vector< InputConfigKeys > vectorInputKeys
void parseConfig(const std::string &fname)
std::string getModelPath() const
std::string getSavedir() const
static std::string expandPath(const std::string &path)
std::vector< InputConfig > vectorInputs
const std::vector< InputConfig > & getVectorInputs() const
const std::vector< std::string > & getOutputNodes() const
std::vector< InputConfig > scalarInputs
static InputConfig parseInput(pt::ptree &tree, const InputConfigKeys &keys)
const std::string CONFIG_NAME
const std::vector< InputConfig > & getScalarInputs() const
ModelConfig(const std::string &savedir, const std::vector< InputConfigKeys > &scalarInputKeys, const std::vector< InputConfigKeys > &vectorInputKeys, const std::vector< std::string > &outputKeys)
const std::string MODEL_NAME
cet::coded_exception< error, detail::translate > exception