python-neo icon indicating copy to clipboard operation
python-neo copied to clipboard

Add a warning when loading a file in a file format that is not cross-version compatible

Open apdavison opened this issue 5 years ago • 2 comments

e.g. PickleIO, see #779

Could also add a warning when writing in such a format.

apdavison avatar Sep 13 '20 12:09 apdavison

What I mean in my original issue is not just a warning for non-cross-platform neo IOs but adding the neo version while dumping the file. Then, if the neo version during the loading does not match, throw a warning:

The file has been saved with Neo v0.7.0. The current Neo version is 0.9.1.

This warning probably does not make sense for IOs like NixIO but it'd help for PickleIO.

Because the original problem arises from different Neo version, not different platforms.

dizcza avatar Sep 23 '20 09:09 dizcza

The NixIO saves the Neo version into a top level metadata section. It doesn't use that information for anything now, but it will certainly be useful if we ever want to support older versions, or throw warnings and errors. I imagine it'll be required with the new ChannelIndex replacement objects. Reading an older file with a newer library should probably try to load the old ChannelIndex objects into the closest new type, but it should also show a warning that that's happening.

achilleas-k avatar Sep 23 '20 10:09 achilleas-k