Skip to content

Commit

Permalink
Revert "Maybe expose this publicly?"
Browse files Browse the repository at this point in the history
This reverts commit f00baa7.
  • Loading branch information
franzpoeschel committed Feb 13, 2024
1 parent a5ce95c commit 1b0062d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 30 deletions.
3 changes: 0 additions & 3 deletions include/openPMD/auxiliary/JSON.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,5 @@ namespace json
*/
std::string
merge(std::string const &defaultValue, std::string const &overwrite);

std::string filterByTemplate(
std::string const &defaultValue, std::string const &positiveMask);
} // namespace json
} // namespace openPMD
22 changes: 0 additions & 22 deletions src/auxiliary/JSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,26 +632,4 @@ filterByTemplate(nlohmann::json &defaultVal, nlohmann::json const &positiveMask)
} // else noop
return defaultVal;
}

std::string filterByTemplate(
std::string const &defaultValue, std::string const &positiveMask)
{
auto [res, returnFormat] =
parseOptions(defaultValue, /* considerFiles = */ false);
filterByTemplate(
res, parseOptions(positiveMask, /* considerFiles = */ false).config);
switch (returnFormat)
{
case SupportedLanguages::JSON:
return res.dump();
break;
case SupportedLanguages::TOML: {
auto asToml = json::jsonToToml(res);
std::stringstream sstream;
sstream << asToml;
return sstream.str();
}
}
throw std::runtime_error("Unreachable!");
}
} // namespace openPMD::json
5 changes: 0 additions & 5 deletions src/binding/python/Series.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,4 @@ users to overwrite default options, while keeping any other ones.
If `defaultValue` was a JSON dataset, then as a JSON string,
otherwise as a TOML string.
)END");
m.def(
"filter_json_by_template",
&json::filterByTemplate,
py::arg("default_value") = "{}",
py::arg("positive_mask") = "{}");
}

0 comments on commit 1b0062d

Please sign in to comment.