From 1b0062d9b2740f4a83100d6784eb46c368d9ffab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Tue, 13 Feb 2024 16:37:54 +0100 Subject: [PATCH] Revert "Maybe expose this publicly?" This reverts commit f00baa7d0d9d1b0dd72aba2631513a12e7c522ae. --- include/openPMD/auxiliary/JSON.hpp | 3 --- src/auxiliary/JSON.cpp | 22 ---------------------- src/binding/python/Series.cpp | 5 ----- 3 files changed, 30 deletions(-) diff --git a/include/openPMD/auxiliary/JSON.hpp b/include/openPMD/auxiliary/JSON.hpp index 93ea8551dd..8c2551fe0a 100644 --- a/include/openPMD/auxiliary/JSON.hpp +++ b/include/openPMD/auxiliary/JSON.hpp @@ -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 diff --git a/src/auxiliary/JSON.cpp b/src/auxiliary/JSON.cpp index 5c78989d46..1472e96558 100644 --- a/src/auxiliary/JSON.cpp +++ b/src/auxiliary/JSON.cpp @@ -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 diff --git a/src/binding/python/Series.cpp b/src/binding/python/Series.cpp index c575dc49f1..ed2a4180a8 100644 --- a/src/binding/python/Series.cpp +++ b/src/binding/python/Series.cpp @@ -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") = "{}"); }