Vindaar / nimhdf5

Wrapper and some simple high-level bindings for the HDF5 library for the Nim language
MIT License
28 stars 2 forks source link

Add distinct types for different `hid_t`, add `=destroy` hooks, ... further mis #47

Closed Vindaar closed 2 years ago

Vindaar commented 2 years ago

What started as a small fix & refactor for iterators and contains procedures, turned into the biggest change in months.

This adds distinct types for the different use cases of hid_t in the HDF5 library, which allows us a much saner, clearer handling of all the funny little identifiers that are used. It gives us the ability to nicely write close procedures for each type as well as helps a bit to finally add =destroy hooks to the library (thanks to them working on refc as well now).

It includes two breaking changes:

Aside from that it includes a lot of clean up, in particular of construction / opening of datasets and groups, plus the below.

Slightly modified version of the original text in this PR:

In addition it includes a bunch of refactors to better separate the modules by what might be needed commonly in other modules. Main problem structuring the existing code is the need to access other procs in other modules, quickly leading to recursive imports. This helps somewhat, among other things it separates out code that is not needed in other procs (as it's mostly user facing).

In addition it fixes a bug with iterators & groups not knowing about their datasets.