Open rly opened 3 years ago
Thanks for creating the issue, @rly. I like the idea of adding a labels
attribute. I think we should make it optional in the schema and throw a warning in PyNWB if ints >1 are used. Also note that we would need to make this 1-indexed instead of 0-indexed because we can't use 0 in the data.
Also note that we would need to make this 1-indexed instead of 0-indexed because we can't use 0 in the data.
Given that ndx_events.LabeledEvents
is 0-indexed and VectorIndex
is 0-indexed, I think it might be more confusing for this to be 1-indexed than if it was 0-indexed and the 0th entry is intentionally left empty. It also depends on the API -- in PyNWB, we can hide this from the user, but in MatNWB, you would have to manage it yourself. What do you think? Either way, it should be clearly documented.
You could require that entry 0 in labels
is always set to no event
You could require that entry 0 in
labels
is always set tono event
Is there a way to require that in the schema? We can write that in the documentation, and we can add a special case in the validator, but I don't think we can formally encode that requirement with the current language.
I don't think we can formally encode that requirement with the current language.
Correct.
From https://nwb-schema.readthedocs.io/en/latest/format.html?highlight=intervalseries#intervalseries
So different data "keys" represent different interval types. But there is no place in
IntervalSeries
that stores what each of those "keys" mean.Proposed solutions:
1) Add an attribute
labels
ondata
with string labels or descriptions of each interval type. Absolute values of values indata
map to an index oflabels
. For example, if the data value is 100 for start interval (and -100 for stop interval), then index 100 of thelabels
attribute contains the string label. This is analogous to how thendx_events.LabeledEvents
type is defined: https://github.com/rly/ndx-events/blob/master/spec/ndx-events.extensions.yaml#L28-L60labels
required?IntervalSeries
would not be valid against the new schema.IntervalSeries
contains multiple interval types. This case cannot easily be validated and would depend on the user reading the documentation forIntervalSeries
and following these guidelines.2) Change the documentation to say that only one interval type should be represented in an
IntervalSeries
and to use multipleIntervalSeries
to store different interval types.cc @bendichter