From 219e1d8bd915da812590f009ff34d95addad2802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Thu, 26 Feb 2026 12:06:10 +0100 Subject: [PATCH 01/13] Fix typing issues with load/store_chunk in Python --- src/binding/python/RecordComponent.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/binding/python/RecordComponent.cpp b/src/binding/python/RecordComponent.cpp index 232df5861d..382783a730 100644 --- a/src/binding/python/RecordComponent.cpp +++ b/src/binding/python/RecordComponent.cpp @@ -489,7 +489,14 @@ inline void store_chunk( check_buffer_is_contiguous(a); - // dtype_from_numpy(a.dtype()) + if (!dtype_to_numpy(r.getDatatype()).is(a.dtype())) + { + std::stringstream err; + err << "Attempting store from Python array of type '" + << dtype_from_numpy(a.dtype()) + << "' into Record Component of type '" << r.getDatatype() << "'."; + throw error::WrongAPIUsage(err.str()); + } switchDatasetType( r.getDatatype(), r, a, offset, extent); } @@ -770,6 +777,15 @@ inline void load_chunk( check_buffer_is_contiguous(a); + if (!dtype_to_numpy(r.getDatatype()).is(a.dtype())) + { + std::stringstream err; + err << "Attempting load into Python array of type '" + << dtype_from_numpy(a.dtype()) + << "' from Record Component of type '" << r.getDatatype() << "'."; + throw error::WrongAPIUsage(err.str()); + } + switchDatasetType( r.getDatatype(), r, a, offset, extent); } From d107a959531fdd7c0d59ccc922e0ecf3960085e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Thu, 26 Feb 2026 13:23:17 +0100 Subject: [PATCH 02/13] Datatype helpers: non-template variants --- include/openPMD/Datatype.hpp | 39 ++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/include/openPMD/Datatype.hpp b/include/openPMD/Datatype.hpp index a11d3db75f..cecfd9bcdb 100644 --- a/include/openPMD/Datatype.hpp +++ b/include/openPMD/Datatype.hpp @@ -294,7 +294,8 @@ template inline constexpr Datatype determineDatatype(T &&val) { (void)val; // don't need this, it only has a name for Doxygen - using T_stripped = std::remove_cv_t>; + using T_stripped = + std::remove_extent_t>>; if constexpr (auxiliary::IsPointer_v) { return determineDatatype>(); @@ -595,14 +596,19 @@ inline std::tuple isInteger() */ template inline bool isSameFloatingPoint(Datatype d) +{ + return isSameFloatingPoint(d, determineDatatype()); +} + +inline bool isSameFloatingPoint(Datatype d1, Datatype d2) { // template - bool tt_is_fp = isFloatingPoint(); + bool tt_is_fp = isFloatingPoint(d1); // Datatype - bool dt_is_fp = isFloatingPoint(d); + bool dt_is_fp = isFloatingPoint(d2); - if (tt_is_fp && dt_is_fp && toBits(d) == toBits(determineDatatype())) + if (tt_is_fp && dt_is_fp && toBits(d1) == toBits(d2)) return true; else return false; @@ -617,15 +623,19 @@ inline bool isSameFloatingPoint(Datatype d) */ template inline bool isSameComplexFloatingPoint(Datatype d) +{ + return isSameComplexFloatingPoint(d, determineDatatype()); +} + +inline bool isSameComplexFloatingPoint(Datatype d1, Datatype d2) { // template - bool tt_is_cfp = isComplexFloatingPoint(); + bool tt_is_cfp = isComplexFloatingPoint(d1); // Datatype - bool dt_is_cfp = isComplexFloatingPoint(d); + bool dt_is_cfp = isComplexFloatingPoint(d2); - if (tt_is_cfp && dt_is_cfp && - toBits(d) == toBits(determineDatatype())) + if (tt_is_cfp && dt_is_cfp && toBits(d1) == toBits(d2)) return true; else return false; @@ -640,17 +650,22 @@ inline bool isSameComplexFloatingPoint(Datatype d) */ template inline bool isSameInteger(Datatype d) +{ + return isSameInteger(d, determineDatatype()); +} + +inline bool isSameInteger(Datatype d1, Datatype d2) { // template bool tt_is_int, tt_is_sig; - std::tie(tt_is_int, tt_is_sig) = isInteger(); + std::tie(tt_is_int, tt_is_sig) = isInteger(d1); // Datatype bool dt_is_int, dt_is_sig; - std::tie(dt_is_int, dt_is_sig) = isInteger(d); + std::tie(dt_is_int, dt_is_sig) = isInteger(d2); if (tt_is_int && dt_is_int && tt_is_sig == dt_is_sig && - toBits(d) == toBits(determineDatatype())) + toBits(d1) == toBits(d2)) return true; else return false; @@ -691,6 +706,8 @@ constexpr bool isChar(Datatype d) template constexpr bool isSameChar(Datatype d); +constexpr bool isSameChar(Datatype d1, Datatype d2); + /** Comparison for two Datatypes * * Besides returning true for the same types, identical implementations on From 45f41331e55b2dd1a6e9b97e584ea3ba3e55a8f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Thu, 26 Feb 2026 13:58:45 +0100 Subject: [PATCH 03/13] Unify Datatype equality semantics --- include/openPMD/Datatype.hpp | 37 ++------------ include/openPMD/Datatype.tpp | 51 +++++++++++++++++++ .../openPMD/backend/PatchRecordComponent.hpp | 10 +--- 3 files changed, 56 insertions(+), 42 deletions(-) diff --git a/include/openPMD/Datatype.hpp b/include/openPMD/Datatype.hpp index cecfd9bcdb..17cf6b67f4 100644 --- a/include/openPMD/Datatype.hpp +++ b/include/openPMD/Datatype.hpp @@ -420,6 +420,8 @@ inline size_t toBits(Datatype d) return toBytes(d) * CHAR_BIT; } +constexpr bool isSigned(Datatype d); + /** Compare if a Datatype is a vector type * * @param d Datatype to test @@ -714,40 +716,7 @@ constexpr bool isSameChar(Datatype d1, Datatype d2); * some platforms, e.g. if long and long long are the same or double and * long double will also return true. */ -inline bool isSame(openPMD::Datatype const d, openPMD::Datatype const e) -{ - // exact same type - if (static_cast(d) == static_cast(e)) - return true; - - bool d_is_vec = isVector(d); - bool e_is_vec = isVector(e); - - // same int - bool d_is_int, d_is_sig; - std::tie(d_is_int, d_is_sig) = isInteger(d); - bool e_is_int, e_is_sig; - std::tie(e_is_int, e_is_sig) = isInteger(e); - if (d_is_int && e_is_int && d_is_vec == e_is_vec && d_is_sig == e_is_sig && - toBits(d) == toBits(e)) - return true; - - // same float - bool d_is_fp = isFloatingPoint(d); - bool e_is_fp = isFloatingPoint(e); - - if (d_is_fp && e_is_fp && d_is_vec == e_is_vec && toBits(d) == toBits(e)) - return true; - - // same complex floating point - bool d_is_cfp = isComplexFloatingPoint(d); - bool e_is_cfp = isComplexFloatingPoint(e); - - if (d_is_cfp && e_is_cfp && d_is_vec == e_is_vec && toBits(d) == toBits(e)) - return true; - - return false; -} +constexpr bool isSame(openPMD::Datatype d, openPMD::Datatype e); /** * @brief basicDatatype Strip openPMD Datatype of std::vector, std::array et. diff --git a/include/openPMD/Datatype.tpp b/include/openPMD/Datatype.tpp index 6685c62f73..e35f2e26b6 100644 --- a/include/openPMD/Datatype.tpp +++ b/include/openPMD/Datatype.tpp @@ -25,6 +25,7 @@ // comment to prevent clang-format from moving this #include up // datatype macros may be included and un-included in other headers #include "openPMD/DatatypeMacros.hpp" +#include "openPMD/auxiliary/TypeTraits.hpp" #include #include // std::void_t @@ -253,6 +254,56 @@ constexpr inline bool isSameChar(Datatype d) { return switchType>(d); } + +namespace detail +{ + struct IsSigned + { + template + static constexpr bool call() + { + if constexpr (auxiliary::IsVector_v || auxiliary::IsArray_v) + { + return call(); + } + else if constexpr (std::is_same_v) + { + return call(); + } + else + { + return std::is_signed_v; + } + } + + static constexpr char const *errorMsg = "IsSigned"; + }; +} // namespace detail + +constexpr inline bool isSigned(Datatype d) +{ + return switchType(d); +} + +constexpr inline bool isSameChar(Datatype d, Datatype e) +{ + return isChar(d) && isChar(e) && isSigned(d) == isSigned(e); +} + +constexpr bool isSame(openPMD::Datatype const d, openPMD::Datatype const e) +{ + return + // exact same type + static_cast(d) == static_cast(e) + // same int + || isSameInteger(d, e) + // same float + || isSameFloatingPoint(d, e) + // same complex floating point + || isSameComplexFloatingPoint(d, e) + // same char + || isSameChar(d, e); +} } // namespace openPMD #include "openPMD/UndefDatatypeMacros.hpp" diff --git a/include/openPMD/backend/PatchRecordComponent.hpp b/include/openPMD/backend/PatchRecordComponent.hpp index fed17dfd3b..63c8b34f92 100644 --- a/include/openPMD/backend/PatchRecordComponent.hpp +++ b/include/openPMD/backend/PatchRecordComponent.hpp @@ -160,10 +160,7 @@ template inline void PatchRecordComponent::store(uint64_t idx, T data) { Datatype dtype = determineDatatype(); - if (dtype != getDatatype() && !isSameInteger(getDatatype()) && - !isSameFloatingPoint(getDatatype()) && - !isSameComplexFloatingPoint(getDatatype()) && - !isSameChar(getDatatype())) + if (dtype != getDatatype()) { std::ostringstream oss; oss << "Datatypes of patch data (" << dtype << ") and dataset (" @@ -190,10 +187,7 @@ template inline void PatchRecordComponent::store(T data) { Datatype dtype = determineDatatype(); - if (dtype != getDatatype() && !isSameInteger(getDatatype()) && - !isSameFloatingPoint(getDatatype()) && - !isSameComplexFloatingPoint(getDatatype()) && - !isSameChar(getDatatype())) + if (dtype != getDatatype()) { std::ostringstream oss; oss << "Datatypes of patch data (" << dtype << ") and dataset (" From 1dda5292b9560cd71e1b5450dbdc17f212b80c3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Thu, 26 Feb 2026 14:09:00 +0100 Subject: [PATCH 04/13] Remove further unnecessary check --- src/RecordComponent.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/RecordComponent.cpp b/src/RecordComponent.cpp index c6eef23313..9bfdfa9167 100644 --- a/src/RecordComponent.cpp +++ b/src/RecordComponent.cpp @@ -835,19 +835,15 @@ void RecordComponent::loadChunk(std::shared_ptr data, Offset o, Extent e) * Ref. `if (constant())` branch. */ if (dtype != getDatatype() && !constant()) - if (!isSameInteger(getDatatype()) && - !isSameFloatingPoint(getDatatype()) && - !isSameComplexFloatingPoint(getDatatype()) && - !isSameChar(getDatatype())) - { - std::string const data_type_str = datatypeToString(getDatatype()); - std::string const requ_type_str = - datatypeToString(determineDatatype()); - std::string err_msg = - "Type conversion during chunk loading not yet implemented! "; - err_msg += "Data: " + data_type_str + "; Load as: " + requ_type_str; - throw std::runtime_error(err_msg); - } + { + std::string const data_type_str = datatypeToString(getDatatype()); + std::string const requ_type_str = + datatypeToString(determineDatatype()); + std::string err_msg = + "Type conversion during chunk loading not yet implemented! "; + err_msg += "Data: " + data_type_str + "; Load as: " + requ_type_str; + throw std::runtime_error(err_msg); + } uint8_t dim = getDimensionality(); From 0295eb25430d3b7edebed6f9fb695a2b936a8521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Thu, 26 Feb 2026 15:08:03 +0100 Subject: [PATCH 05/13] Fix wrong type specifications in tests --- test/python/unittest/API/APITest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/python/unittest/API/APITest.py b/test/python/unittest/API/APITest.py index c22551a074..1c2a758649 100644 --- a/test/python/unittest/API/APITest.py +++ b/test/python/unittest/API/APITest.py @@ -2217,25 +2217,25 @@ def testCustomGeometries(self): E = write.iterations[0].meshes["E"] E.set_attribute("geometry", "other:customGeometry") E_x = E["x"] - E_x.reset_dataset(DS(DT.LONG, [10])) + E_x.reset_dataset(DS(np.dtype(np.int_), [10])) E_x[:] = sample_data B = write.iterations[0].meshes["B"] B.set_geometry("customGeometry") B_x = B["x"] - B_x.reset_dataset(DS(DT.LONG, [10])) + B_x.reset_dataset(DS(np.dtype(np.int_), [10])) B_x[:] = sample_data e_energyDensity = write.iterations[0].meshes["e_energyDensity"] e_energyDensity.set_geometry("other:customGeometry") e_energyDensity_x = e_energyDensity[io.Mesh_Record_Component.SCALAR] - e_energyDensity_x.reset_dataset(DS(DT.LONG, [10])) + e_energyDensity_x.reset_dataset(DS(np.dtype(np.int_), [10])) e_energyDensity_x[:] = sample_data e_chargeDensity = write.iterations[0].meshes["e_chargeDensity"] e_chargeDensity.set_geometry(io.Geometry.other) e_chargeDensity_x = e_chargeDensity[io.Mesh_Record_Component.SCALAR] - e_chargeDensity_x.reset_dataset(DS(DT.LONG, [10])) + e_chargeDensity_x.reset_dataset(DS(np.dtype(np.int_), [10])) e_chargeDensity_x[:] = sample_data self.assertTrue(write) From a3237f2e34e5349248ba791782736b4b1beedb78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Fri, 27 Feb 2026 12:40:13 +0100 Subject: [PATCH 06/13] tmp: CI debugging --- include/openPMD/Datatype.tpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/openPMD/Datatype.tpp b/include/openPMD/Datatype.tpp index e35f2e26b6..9352a05c1d 100644 --- a/include/openPMD/Datatype.tpp +++ b/include/openPMD/Datatype.tpp @@ -292,7 +292,7 @@ constexpr inline bool isSameChar(Datatype d, Datatype e) constexpr bool isSame(openPMD::Datatype const d, openPMD::Datatype const e) { - return + auto res = // exact same type static_cast(d) == static_cast(e) // same int @@ -303,6 +303,14 @@ constexpr bool isSame(openPMD::Datatype const d, openPMD::Datatype const e) || isSameComplexFloatingPoint(d, e) // same char || isSameChar(d, e); + if (!res) + { + std::cerr << "Comparing Datatype " << d << " to " << e << " failed:\n"; + std::cerr << "\t(signed: " << isSigned(d) << ", size: " << toBits(d) + << ") -- (signed: " << isSigned(e) << ", size: " << toBits(e) + << ")" << std::endl; + } + return res; } } // namespace openPMD From e8c3efbce315336afbc51b46933a08999a5af2b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Fri, 27 Feb 2026 18:43:22 +0100 Subject: [PATCH 07/13] Revert "tmp: CI debugging" This reverts commit a3237f2e34e5349248ba791782736b4b1beedb78. --- include/openPMD/Datatype.tpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/include/openPMD/Datatype.tpp b/include/openPMD/Datatype.tpp index 9352a05c1d..e35f2e26b6 100644 --- a/include/openPMD/Datatype.tpp +++ b/include/openPMD/Datatype.tpp @@ -292,7 +292,7 @@ constexpr inline bool isSameChar(Datatype d, Datatype e) constexpr bool isSame(openPMD::Datatype const d, openPMD::Datatype const e) { - auto res = + return // exact same type static_cast(d) == static_cast(e) // same int @@ -303,14 +303,6 @@ constexpr bool isSame(openPMD::Datatype const d, openPMD::Datatype const e) || isSameComplexFloatingPoint(d, e) // same char || isSameChar(d, e); - if (!res) - { - std::cerr << "Comparing Datatype " << d << " to " << e << " failed:\n"; - std::cerr << "\t(signed: " << isSigned(d) << ", size: " << toBits(d) - << ") -- (signed: " << isSigned(e) << ", size: " << toBits(e) - << ")" << std::endl; - } - return res; } } // namespace openPMD From a41b6e5b36f9cca1cd5c57141f94624a1e377884 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Fri, 27 Feb 2026 18:43:52 +0100 Subject: [PATCH 08/13] Hm check if HDF5 is the culprit --- test/SerialIOTest.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/SerialIOTest.cpp b/test/SerialIOTest.cpp index 49aab1db18..7bcdefa27c 100644 --- a/test/SerialIOTest.cpp +++ b/test/SerialIOTest.cpp @@ -184,6 +184,8 @@ TEST_CASE("char_roundtrip", "[serial]") { for (auto const &t : testedFileExtensions()) { + if (t == "h5") + continue; char_roundtrip(t); } } From 579e0631cf3ef4bacd4374f46d2a81ccc0264612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Mon, 2 Mar 2026 13:33:21 +0100 Subject: [PATCH 09/13] Revert "Hm check if HDF5 is the culprit" This reverts commit a41b6e5b36f9cca1cd5c57141f94624a1e377884. --- test/SerialIOTest.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/SerialIOTest.cpp b/test/SerialIOTest.cpp index 7bcdefa27c..49aab1db18 100644 --- a/test/SerialIOTest.cpp +++ b/test/SerialIOTest.cpp @@ -184,8 +184,6 @@ TEST_CASE("char_roundtrip", "[serial]") { for (auto const &t : testedFileExtensions()) { - if (t == "h5") - continue; char_roundtrip(t); } } From 1bcaff43e7be0c3c392d7ca58249767db985cd4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Mon, 2 Mar 2026 13:43:39 +0100 Subject: [PATCH 10/13] Fix type comparison for Windows --- include/openPMD/backend/PatchRecordComponent.hpp | 3 ++- src/RecordComponent.cpp | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/openPMD/backend/PatchRecordComponent.hpp b/include/openPMD/backend/PatchRecordComponent.hpp index 63c8b34f92..85e330d0f6 100644 --- a/include/openPMD/backend/PatchRecordComponent.hpp +++ b/include/openPMD/backend/PatchRecordComponent.hpp @@ -122,7 +122,8 @@ template inline void PatchRecordComponent::load(std::shared_ptr data) { Datatype dtype = determineDatatype(); - if (dtype != getDatatype()) + // Attention: Do NOT use operator==(), doesnt work properly on Windows! + if (!isSame(dtype, getDatatype())) throw std::runtime_error( "Type conversion during particle patch loading not yet " "implemented"); diff --git a/src/RecordComponent.cpp b/src/RecordComponent.cpp index 9bfdfa9167..752b54c801 100644 --- a/src/RecordComponent.cpp +++ b/src/RecordComponent.cpp @@ -833,8 +833,10 @@ void RecordComponent::loadChunk(std::shared_ptr data, Offset o, Extent e) * JSON/TOML backends as they might implicitly turn a LONG into an INT in a * constant component. The frontend needs to catch such edge cases. * Ref. `if (constant())` branch. + * + * Attention: Do NOT use operator==(), doesnt work properly on Windows! */ - if (dtype != getDatatype() && !constant()) + if (!isSame(dtype, getDatatype()) && !constant()) { std::string const data_type_str = datatypeToString(getDatatype()); std::string const requ_type_str = From 2268c24299e300193817dfe5bca2ef2fb76a9eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Mon, 2 Mar 2026 13:45:05 +0100 Subject: [PATCH 11/13] CI fixes rerun ci --- test/python/unittest/API/APITest.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/python/unittest/API/APITest.py b/test/python/unittest/API/APITest.py index 1c2a758649..00146026f2 100644 --- a/test/python/unittest/API/APITest.py +++ b/test/python/unittest/API/APITest.py @@ -2209,7 +2209,6 @@ def testError(self): def testCustomGeometries(self): DS = io.Dataset - DT = io.Datatype sample_data = np.ones([10], dtype=np.int_) write = io.Series("../samples/custom_geometries_python.json", From 001f27fd80fd666061354f5130e850a9b1761f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Tue, 3 Mar 2026 17:30:36 +0100 Subject: [PATCH 12/13] Try replacing operator==() by isSame() --- src/IO/ADIOS/ADIOS2PreloadAttributes.cpp | 2 +- src/IO/JSON/JSONIOHandlerImpl.cpp | 2 +- src/RecordComponent.cpp | 2 +- src/Series.cpp | 5 ++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/IO/ADIOS/ADIOS2PreloadAttributes.cpp b/src/IO/ADIOS/ADIOS2PreloadAttributes.cpp index 2b9bb02c2d..a9adbb74d6 100644 --- a/src/IO/ADIOS/ADIOS2PreloadAttributes.cpp +++ b/src/IO/ADIOS/ADIOS2PreloadAttributes.cpp @@ -248,7 +248,7 @@ PreloadAdiosAttributes::getAttribute(std::string const &name) const } AttributeLocation const &location = it->second; Datatype determinedDatatype = determineDatatype(); - if (location.dt != determinedDatatype) + if (!isSame(location.dt, determinedDatatype)) { std::stringstream errorMsg; errorMsg << "[ADIOS2] Wrong datatype for attribute: " << name diff --git a/src/IO/JSON/JSONIOHandlerImpl.cpp b/src/IO/JSON/JSONIOHandlerImpl.cpp index 59541c1e30..551b6c4358 100644 --- a/src/IO/JSON/JSONIOHandlerImpl.cpp +++ b/src/IO/JSON/JSONIOHandlerImpl.cpp @@ -2332,7 +2332,7 @@ auto JSONIOHandlerImpl::verifyDataset( } Datatype dt = stringToDatatype(j["datatype"].get()); VERIFY_ALWAYS( - dt == parameters.dtype, + isSame(dt, parameters.dtype), "[JSON] Read/Write request does not fit the dataset's type"); } catch (json::basic_json::type_error &) diff --git a/src/RecordComponent.cpp b/src/RecordComponent.cpp index 752b54c801..fbf2ad0d88 100644 --- a/src/RecordComponent.cpp +++ b/src/RecordComponent.cpp @@ -657,7 +657,7 @@ void RecordComponent::verifyChunk( if (empty()) throw std::runtime_error( "Chunks cannot be written for an empty RecordComponent."); - if (dtype != getDatatype()) + if (!isSame(dtype, getDatatype())) { std::ostringstream oss; oss << "Datatypes of chunk data (" << dtype diff --git a/src/Series.cpp b/src/Series.cpp index a826303193..f7ed6964b8 100644 --- a/src/Series.cpp +++ b/src/Series.cpp @@ -1950,12 +1950,11 @@ void Series::readOneIterationFileBased(std::string const &filePath) readBase(); - using DT = Datatype; aRead.name = "iterationEncoding"; IOHandler()->enqueue(IOTask(this, aRead)); IOHandler()->flush(internal::defaultFlushParams); IterationEncoding encoding_out; - if (*aRead.dtype == DT::STRING) + if (isSame(*aRead.dtype, Datatype::STRING)) { std::string encoding = Attribute(Attribute::from_any, *aRead.m_resource) .get(); @@ -2010,7 +2009,7 @@ void Series::readOneIterationFileBased(std::string const &filePath) aRead.name = "iterationFormat"; IOHandler()->enqueue(IOTask(this, aRead)); IOHandler()->flush(internal::defaultFlushParams); - if (*aRead.dtype == DT::STRING) + if (isSame(*aRead.dtype, Datatype::STRING)) { setWritten(false, Attributable::EnqueueAsynchronously::No); setIterationFormat(Attribute(Attribute::from_any, *aRead.m_resource) From 1d669d4357219ffcea476d2cb143921ed3547f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Wed, 4 Mar 2026 11:03:37 +0100 Subject: [PATCH 13/13] replace operator==(Datatype, Datatype) by isSame --- include/openPMD/backend/PatchRecordComponent.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/openPMD/backend/PatchRecordComponent.hpp b/include/openPMD/backend/PatchRecordComponent.hpp index 85e330d0f6..eedd84e158 100644 --- a/include/openPMD/backend/PatchRecordComponent.hpp +++ b/include/openPMD/backend/PatchRecordComponent.hpp @@ -161,7 +161,7 @@ template inline void PatchRecordComponent::store(uint64_t idx, T data) { Datatype dtype = determineDatatype(); - if (dtype != getDatatype()) + if (!isSame(dtype, getDatatype())) { std::ostringstream oss; oss << "Datatypes of patch data (" << dtype << ") and dataset (" @@ -188,7 +188,7 @@ template inline void PatchRecordComponent::store(T data) { Datatype dtype = determineDatatype(); - if (dtype != getDatatype()) + if (!isSame(dtype, getDatatype())) { std::ostringstream oss; oss << "Datatypes of patch data (" << dtype << ") and dataset ("