Apollo3zehn / PureHDF

A pure .NET library that makes reading and writing of HDF5 files (groups, datasets, attributes, ...) very easy.
MIT License
47 stars 16 forks source link

Honor H5Name for Compound Writing #85

Closed Blackclaws closed 1 week ago

Blackclaws commented 1 month ago

When writing compound datatypes H5Name is used during read but not for writing.

Not urgent in any case but I saw tried this and it didn't work.

Apollo3zehn commented 1 month ago

You need a field/property name mapper for both, reading and writing to take the attribute into account. PureHDF itself has no logic to make use of that attribute. Here is an example from the tests of how to create and use such a mapper:

https://github.com/Apollo3zehn/PureHDF/blob/f7d1521d32e8faa943993befa9eac66572761ce3/tests/PureHDF.Tests/Writing/DatasetTests%40datatypes.cs#L27-L43

If reading is working without this mapper, I am a bit confused :-)

Apollo3zehn commented 1 month ago

Maybe I need to update the docs.

Blackclaws commented 1 month ago

Ah! I think I missed that in the docs and thought that similar to how Json serializers work it would automatically pick them up.