Closed johnkerl closed 1 year ago
Background and proposals from today's weekly spec meeting.
[2:4]
means indices 2 and 3[0:n]
specifies n
thingsn
: x[-2]
is the same as x[n-2]
where n
is the array length[2:4]
means indices 2, 3, and 4[1:n]
specifies n
thingsseq(1,5)[c(-2,-4)]
results in 1, 3, 5[...]
(__getitem__
/__setitem__
) indexer.multi_index
/df
indexer uses doubly inclusive rangesmulti_index
indexer works the way it does for the same reason that pandas .sel
is doubly inclusive -- in particular, What would the semantics of a half-open query look like for floating-point or string coordinate queries?[0:4]
and realize “Hey those are four things not five” (or vice versa). But for longer-length queries, and especially with sparse data, people might not even know they’re off by one -- doing [0:1000]
might produce 164 things rather than 163 or 165 and there’s no clear indicator that they got it wrongTileDB-SOMA-Py
or TileDB-SOMA-R
n
results in n
thingsTileDB-SOMA-Py
and TileDB-SOMA-R
(and any future implementation languages)experiment.obs[m:n]
but rather experiment.obs.method_name_goes_here[m:n]
Pending review of https://github.com/single-cell-data/SOMA/pull/52
The spec says things like
-- we need to make this clear. I believe doubly inclusive is the right way to go but this issue will involve getting consensus on a soma-spec PR.