G-Node / python-neo

Fork of python-neo for maintaining the NIX IO.
https://github.com/NeuralEnsemble/python-neo
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Optimise name conflict resolution #10

Closed achilleas-k closed 7 years ago

achilleas-k commented 7 years ago

Currently, resolving name conflicts, which also includes assigning names to anonymous Neo objects, is very inefficient. A workaround currently exists in the nixio-optimisations branch, but this has a couple of issues. The way it works is it keeps a count of each object type and if a Neo object has no name (None or "") it will just name it based on the count. One issue is that, if there are objects that do have a name but the name is not unique, the workaround will ignore the conflict. It's also unclear how it behaves with partial writes.

One way around it would be to simply pass along the Neo object name to NIX, catch specific exceptions, and then do a rename.

As for the problem with partial writes, it's already difficult to distinguish between writing new objects vs overwriting/updating existing objects. With the new name conflict avoidance/resolution comes one major change: the original Neo objects aren't renamed (which is a good thing). This makes tracking the correspondence between Neo and NIX objects harder, although we do keep track of them in the neo-nixio during a session.

achilleas-k commented 7 years ago

Tests will also need to be updated once a change is finalised. For now, I am disabling or working around test cases that are broken by the count-based naming.

achilleas-k commented 7 years ago

Tests have been updated and the pull request is open in the upstream repository (NeuralEnsemble/python-neo#331).

NeuralEnsemble/python-neo#311 is where the new naming scheme was discussed.