-
Notifications
You must be signed in to change notification settings - Fork 261
Merge of AnalogSignal and AnalogSignalArray, etc. #210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Note that the reorganisation of the container classes is not yet done.
…are now properties pointing to the `channel_indexes` attribute of a parent `RecordingChannelGroup`.
@samuelgarcia @rproepp @toddrjen any comments? |
Hi Andrew, thank you for starting this big clean.
|
@samuelgarcia : have you had any time to look at this again? Concerning the name "RecordingChannelGroup", we could change it to "RecordingChannelIndex". I think that might be a more accurate name. |
I am very happy about the change with AnalogSignal, this is also very much in line with what users in our lab would prefer. Regarding the change in the RecordingChannel, in principle I agree that this could be a step forward. I frequently notice puzzled looks when trying to explain the hierarchy of RecordingChannel and RecordingChannelGroup to others (although in principle, it was pretty clear as such). In addition, Andrew is right that the channel_index had always caused confusion due to its ambiguity with the hierarchy. I find that it is difficult to foresee the problems that might arise due to this change, and I could not come up with any particular scenario that might be super problematic. I think that almost any recording (even simulation) will be able to distribute a meaningful index number per "channel", so that creating a fitting data structure to match up almost any data set should be straightforward. What is important in my opinion is to provide (by and by) an API for all common use-cases to traverse the hierarchy and the array-like data structures by channel_index. For instance, what are the AnalogSignals that belong to my SpikeTrain/Unit. Furthermore, I guess it would be good to have Neo check that the tree hierarchy is always consistent with respect to channel indices (e.g., duplicate channel indices, etc...), and that Neo provides functions such as "get_all_channel_indices()" for easy access. In short I support to give this simplification of the structure a try. In terms of the name, I like "RecrodingChannelIndex" because it avoids confusion with the existing object. But how about shortening this object to "ChannelIndex"? I would image that in ephys, the concept of "channel" is pretty clear even without attaching "Recording". |
I like the idea of "ChannelIndex" |
…nelGroup.channel_index` in place of `RecordingChannel`
@samuelgarcia @mdenker I've now adapted most of the IO classes, at least partially. The biggest changes are to |
Hi Andrew, I don't anderstand your comment on BlackrockIO. I don't see 2D analogSignal in BlackrockIO.read_nsx but still a list of 1D AnalogSignal. Did you need some help to do this ? |
See this line: https://github.com/apdavison/python-neo/blob/analogsignal/neo/io/blackrockio.py#L398
|
This PR is anyway for merging into the apibreak branch, not into master. We should definitely make an 0.3.4 release before we merge apibreak into master, but before then I want to improve the documentation, add a "migrating from 0.3 to 0.4" guide, and fix the |
OK thanks I have not seen it. |
I'm going to merge this now, and then finish the work in the |
Merge of AnalogSignal and AnalogSignalArray, etc.
This is a first attempt at the next step in the API-breaking changes intended for Neo 0.4.
Changes:
AnalogSignalArray
and removed the originalAnalogSignal
class (cf Codejam #6 : remove scalar object #124). All signals are now represented by 2-dimensional arrays, even if there is only a single channel. For convenience, objects can still be constructed using a 1-D array.IrregularlySampledSignal
to that of the newAnalogSignal
, i.e. it can now contain multiple channels, with all channels sampled at the same, explicitly-stored time points.RecordingChannel
class. With most of the data types now being 2D arrays (except SpikeTrain), this class now seems superfluous. Its function is replaced by achannel_indexes
attribute onRecordingChannelGroup
.AnalogSignal.channel_indexes
andUnit.channel_indexes
attributes are now properties pointing to thechannel_indexes
attribute of the parentRecordingChannelGroup
. This removes a redundancy in which there were two independent ways of keeping track of channels.With these changes, the object model looks rather simple and elegant, but I'm concerned I've missed something obvious, so please check these changes don't break important use cases.
Note: I modified the tests in a rather ad hoc fashion to get them to pass, so this PR is not intended for merging yet, rather for discussion. I'll clean things up and improve the tests if the general principles are agreed upon.
Also note that of course none of the IO classes have been updated yet.