toolsforexperiments / plottr

A flexible plotting and data analysis tool.
https://github.com/toolsforexperiments/plottr
MIT License
46 stars 55 forks source link

Fix the wrong selection of AppendMode in DDH5Writer.add_data #378

Closed yoshi74ls181 closed 1 year ago

yoshi74ls181 commented 1 year ago

Currently, DDH5Writer.add_data selects the AppendMode according to DDH5Writer.inserted_rows, which is not incremented correctly. Because of this, DDH5Writer.add_data always selects AppendMode.none and unnecessarily re-creates the ddh5 file every time a row of data is added. This bugfix removes the part where DDH5Writer.add_data incorrectly sets the AppendMode and lets datadict_to_hdf5 decide whether to re-create or append to the ddh5 file. I have also removed DDH5Writer.inserted_rows because it is not used anywhere else.

marcosfrenkel commented 1 year ago

@yoshi74ls181 This looks good! nice catch, could you update the branch so that this merges?