From 75759344b4122eeaa4ec99fc02ca0aa310217596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Thu, 4 Jan 2024 11:56:29 +0100 Subject: [PATCH] Revert "Add openPMD 2.0 standard setting" This reverts commit 1cade93df780d8a02136235edfa387e740e4fa5d. --- include/openPMD/Error.hpp | 6 ------ include/openPMD/version.hpp | 20 ++------------------ src/Error.cpp | 6 ------ src/Series.cpp | 13 +++++-------- src/binding/python/Error.cpp | 3 --- src/version.cpp | 10 ---------- test/CoreTest.cpp | 5 +---- test/SerialIOTest.cpp | 1 - 8 files changed, 8 insertions(+), 56 deletions(-) diff --git a/include/openPMD/Error.hpp b/include/openPMD/Error.hpp index d1762e7e6d..3e516e16ec 100644 --- a/include/openPMD/Error.hpp +++ b/include/openPMD/Error.hpp @@ -109,12 +109,6 @@ namespace error public: NoSuchAttribute(std::string attributeName); }; - - class IllegalInOpenPMDStandard : public Error - { - public: - IllegalInOpenPMDStandard(std::string what); - }; } // namespace error /** diff --git a/include/openPMD/version.hpp b/include/openPMD/version.hpp index e9748b3939..c57e3ecf17 100644 --- a/include/openPMD/version.hpp +++ b/include/openPMD/version.hpp @@ -37,20 +37,11 @@ * compile-time) * @{ */ -#define OPENPMD_STANDARD_MAJOR 2 -#define OPENPMD_STANDARD_MINOR 0 +#define OPENPMD_STANDARD_MAJOR 1 +#define OPENPMD_STANDARD_MINOR 1 #define OPENPMD_STANDARD_PATCH 0 /** @} */ -/** maximum supported version of the openPMD standard (read & write, - * compile-time) - * @{ - */ -#define OPENPMD_STANDARD_DEFAULT_MAJOR 1 -#define OPENPMD_STANDARD_DEFAULT_MINOR 1 -#define OPENPMD_STANDARD_DEFAULT_PATCH 0 -/** @} */ - /** minimum supported version of the openPMD standard (read, compile-time) * @{ */ @@ -88,13 +79,6 @@ std::string getVersion(); */ std::string getStandard(); -/** Return the default used version of the openPMD standard (read & write, - * run-time) - * - * @return std::string openPMD standard version (dot separated) - */ -std::string getStandardDefault(); - /** Return the minimum supported version of the openPMD standard (read, * run-time) * diff --git a/src/Error.cpp b/src/Error.cpp index dbc13f40b0..f2e27a0213 100644 --- a/src/Error.cpp +++ b/src/Error.cpp @@ -122,12 +122,6 @@ namespace error , description(std::move(description_in)) {} - IllegalInOpenPMDStandard::IllegalInOpenPMDStandard(std::string what_in) - : Error( - "Operation leads to illegal use of the openPMD standard:\n" + - std::move(what_in)) - {} - void throwReadError( AffectedObject affectedObject, Reason reason, diff --git a/src/Series.cpp b/src/Series.cpp index b2c5fc5667..32dc0b3a40 100644 --- a/src/Series.cpp +++ b/src/Series.cpp @@ -147,10 +147,9 @@ std::string Series::basePath() const Series &Series::setBasePath(std::string const &bp) { std::string version = openPMD(); - if (version == "1.0.0" || version == "1.0.1" || version == "1.1.0" || - version == "2.0.0") + if (version == "1.0.0" || version == "1.0.1" || version == "1.1.0") throw std::runtime_error( - "Custom basePath not allowed in openPMD <=2.0"); + "Custom basePath not allowed in openPMD <=1.1.0"); setAttribute("basePath", bp); return *this; @@ -685,7 +684,7 @@ void Series::initDefaults(IterationEncoding ie, bool initAll) } } if (!containsAttribute("openPMD")) - setOpenPMD(getStandardDefault()); + setOpenPMD(getStandard()); /* * In Append mode, only init the rest of the defaults after checking that * the file does not yet exist to avoid overriding more than needed. @@ -1269,8 +1268,7 @@ void Series::readOneIterationFileBased(std::string const &filePath) Parameter pOpen; std::string version = openPMD(); - if (version == "1.0.0" || version == "1.0.1" || version == "1.1.0" || - version == "2.0.0") + if (version == "1.0.0" || version == "1.0.1" || version == "1.1.0") pOpen.path = auxiliary::replace_first(basePath(), "/%T/", ""); else throw error::ReadError( @@ -1422,8 +1420,7 @@ creating new iterations. Parameter pOpen; std::string version = openPMD(); - if (version == "1.0.0" || version == "1.0.1" || version == "1.1.0" || - version == "2.0.0") + if (version == "1.0.0" || version == "1.0.1" || version == "1.1.0") pOpen.path = auxiliary::replace_first(basePath(), "/%T/", ""); else throw error::ReadError( diff --git a/src/binding/python/Error.cpp b/src/binding/python/Error.cpp index 27d9c7d9b4..681398c579 100644 --- a/src/binding/python/Error.cpp +++ b/src/binding/python/Error.cpp @@ -9,7 +9,6 @@ #include "openPMD/Error.hpp" #include "openPMD/binding/python/Common.hpp" -#include void init_Error(py::module &m) { @@ -23,8 +22,6 @@ void init_Error(py::module &m) py::register_exception(m, "ErrorInternal", baseError); py::register_exception( m, "ErrorNoSuchAttribute", baseError); - py::register_exception( - m, "ErrorIllegalInOpenPMDStandard", baseError); #ifndef NDEBUG m.def("test_throw", [](std::string description) { diff --git a/src/version.cpp b/src/version.cpp index 5feeccba13..c2e8809a32 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -41,16 +41,6 @@ std::string openPMD::getStandard() return standard.str(); } -std::string openPMD::getStandardDefault() -{ - std::stringstream standard; - standard << OPENPMD_STANDARD_DEFAULT_MAJOR << "." - << OPENPMD_STANDARD_DEFAULT_MINOR << "." - << OPENPMD_STANDARD_DEFAULT_PATCH; - std::string const standardstr = standard.str(); - return standardstr; -} - std::string openPMD::getStandardMinimum() { std::stringstream standardMin; diff --git a/test/CoreTest.cpp b/test/CoreTest.cpp index ac06aaf4c7..084d118578 100644 --- a/test/CoreTest.cpp +++ b/test/CoreTest.cpp @@ -35,11 +35,8 @@ TEST_CASE("versions_test", "[core]") auto const is_dot = [](char const c) { return c == '.'; }; REQUIRE(2u == std::count_if(apiVersion.begin(), apiVersion.end(), is_dot)); - auto const standardDefault = getStandardDefault(); - REQUIRE(standardDefault == "1.1.0"); - auto const standard = getStandard(); - REQUIRE(standard == "2.0.0"); + REQUIRE(standard == "1.1.0"); auto const standardMin = getStandardMinimum(); REQUIRE(standardMin == "1.0.0"); diff --git a/test/SerialIOTest.cpp b/test/SerialIOTest.cpp index 207ac209d6..3d1970237f 100644 --- a/test/SerialIOTest.cpp +++ b/test/SerialIOTest.cpp @@ -905,7 +905,6 @@ inline void constant_scalar(std::string const &file_ending) // constant scalar Series s = Series("../samples/constant_scalar." + file_ending, Access::CREATE); - s.setOpenPMD("2.0.0"); auto rho = s.iterations[1].meshes["rho"][MeshRecordComponent::SCALAR]; REQUIRE(s.iterations[1].meshes["rho"].scalar()); rho.resetDataset(Dataset(Datatype::CHAR, {1, 2, 3}));