[NixIO] Proper handling of multiple references to the same object#352
Merged
apdavison merged 14 commits intoNeuralEnsemble:masterfrom Sep 9, 2017
Merged
[NixIO] Proper handling of multiple references to the same object#352apdavison merged 14 commits intoNeuralEnsemble:masterfrom
apdavison merged 14 commits intoNeuralEnsemble:masterfrom
Conversation
Similar to adding multiple links to the same AnalogSignal.
Sometimes an object may already be stored in the nix file but not at every location it should be. Until now, if an object was found to be already in the nix file, no operation would take place. We need to check for the case where the object is stored in the file but is not linked to the location we're currently looking at (e.g., a DataArray might have to be linked to multiple groups).
Tests classes are skipped conditionally instead
The IO would keep track of object mappings from Neo object ids to NIX objects and vice versa. We now use the same key to track both kinds of objects in two different maps: one for Neo and one for Neo and one for NIX objects.
4e89cab to
faba6fc
Compare
Class methods are not skipped when module is missing (by the unittest decorator), so we need the checks to avoid failing when there is no NIX module.
Contributor
Author
|
I have fixed the issue reported in #356. Should I push it to this PR or open a new one to keep things cleaner? |
Member
|
Whichever you think is best |
Contributor
Author
|
I'll push the fix here, then. Thanks. The new commits fix reading and writing for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, the NixIO does not properly handle cases where the same Neo object is attached to multiple locations. For instance, if an AnalogSignal is attached to multiple Segments, the NixIO will fail on write while attempting to create the same object a second time.
With this PR the IO now detects such cases and mirrors the references between Neo objects as closely as possible in the NIX file (e.g., the DataArray created from the AnalogSignal in the above example will be attached to multiple Groups).
An IO test has been added for this behaviour (
test_multiref_write).The issue was first described in #311 (comment). Since the new naming scheme was already merged and the problem mentioned in the issue is fixed, this PR closes #311.