Skip to content

Harmonize Datatype equality checks#1854

Open
franzpoeschel wants to merge 11 commits intoopenPMD:devfrom
franzpoeschel:fix-datatype-equality
Open

Harmonize Datatype equality checks#1854
franzpoeschel wants to merge 11 commits intoopenPMD:devfrom
franzpoeschel:fix-datatype-equality

Conversation

@franzpoeschel
Copy link
Contributor

@franzpoeschel franzpoeschel commented Feb 26, 2026

currently

We override operator==(Datatype, Datatype) such that it checks Datatype equality by representation on the platform. However, in some places, our loadChunk / storeChunk API still manually implements this check, with slight implementation differences.

with this pr

This PR merges those differences into the operator==() implementation and uses that consistently.

Also:

  • Adds a missing type check for store_chunk / load_chunk in our Python API

  • Adds non-template type comparison operators

  • Maybe add a further overload to Dataset constructor, to avoid this weirdness:

        e_chargeDensity_x.reset_dataset(DS(np.dtype(np.int_), [10]))

@franzpoeschel franzpoeschel force-pushed the fix-datatype-equality branch from dae3b6b to 1ed5125 Compare March 2, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant