Skip to content

Re-factor (and some fixes) of handling of HDF-attributes

Afonso Mukai requested to merge re-factor_of_hdf_attributes into master

Created by: SkyToGround

Description of work

I decided to spend some time re-factoring the HDF-attributes code as it was/is a bit of a mess. A lot more cleanup is possible but I decided to not go too far (at least not yet) in order to retain "unit test accountability" (?) to some degree. This is roughly what has changed on top of the re-factoring:

  • Added code for giving you proper errors and warnings if an unknown config field or field value type is encountered.
  • The shape of metadata and static data arrays was determined differently, this has now been unified to use the shape of the actual data in the JSON-code.
  • Support for any encoding other than UTF8 was removed as I deemed this code to be fragile and incomplete and probably not necessary.
  • Removed use of fixed size strings as I could see no reason (performance or otherwise) to have both and removing that code simplified things a lot.
  • Added unit tests.

I would like to re-factor this code even more and add a lot more unit tests as I consider this code to have a high probability of bugs and a bad consequence of these bugs. Still, I do not think going further than this in a single PR is justified.

Nominate for Group Code Review

  • Nominate for code review

Reminder

Changes should be documented in changes.md

Merge request reports