Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Allow plots.xml to be read if model.xml doesn't contain plots
  • Loading branch information
paulromano committed Apr 11, 2023
commit 35ef5b06f847d43dc0cbebb62c7f42927b2b1fa6
12 changes: 10 additions & 2 deletions src/initialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ bool read_model_xml()
for (const auto& input : other_inputs) {
if (file_exists(settings::path_input + input)) {
warning((fmt::format("Other XML file input(s) are present. These files "
"will be ignored in favor of the {} file.",
"may be ignored in favor of the {} file.",
model_filename)));
break;
}
Expand Down Expand Up @@ -392,8 +392,16 @@ bool read_model_xml()
// Initialize distribcell_filters
prepare_distribcell();

if (check_for_node(root, "plots"))
if (check_for_node(root, "plots")) {
read_plots_xml(root.child("plots"));
} else {
// When no <plots> element is present in the model.xml file, check for a
// regular plots.xml file
std::string filename = settings::path_input + "plots.xml";
if (file_exists(filename)) {
read_plots_xml();
}
}

return true;
}
Expand Down