G-Node / nix

Neuroscience information exchange format
https://readthedocs.org/projects/nixio/
Other
67 stars 36 forks source link

Proof of Concept of FileMode::Force #734

Closed gicmo closed 6 years ago

gicmo commented 6 years ago

Gave it a quick shot, did not touch the FS backend. Might also have missed a spots.

achilleas-k commented 6 years ago

I'm approving this but I think we should mention the implications. We added this feature because we came across the situation of needing to read/write incompatible files for tests. In our case, the files are actually compatible but we come across situations where the version numbers don't match (during dev).

If this feature is used to open truly incompatible files, it may go unnoticed: Say an old, 1.0.0 file is opened and no booleans are read. Alternatively, it could cause an error, in which case you should have known what you were doing is, I suppose, the standard response. Is there a situation where it might cause data loss?

I'm not against having it in the libraries. I can imagine it being used as a data-recovery feature from old files, for instance, where one might not be able to compile/run old versions of the library, but has data in old formats that are partially readable (e.g., the metadata is incompatible, but all the NIX objects are compatible). It would minimise the work one would need to do to read them from the HDF5 level.

achilleas-k commented 6 years ago

snipped non-error report

My bad. All is well.

achilleas-k commented 6 years ago

@gicmo Should I merge this, or would you rather change the force option to a boolean?

gicmo commented 6 years ago

I personally think we (I) should redo this to have a new OpenFlags oflags parameter instead.