Task #9974 (accepted)
Opened 11 years ago
Last modified 8 years ago
OMERO.tables read() row specification is inconsistent
Reported by: | spli | Owned by: | spli |
---|---|---|---|
Priority: | minor | Milestone: | Metadata |
Component: | API | Version: | 5.0.2 |
Keywords: | analysis | Cc: | analysis@…, cneves, ctrueden, jamoore |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | 0.2d |
Sprint: | n.a. |
Description (last modified by spli)
For discussion?
stop=0 is currently treated as a special case, eg:
- read(start=0, stop=0) returns row 0
read(start=i, stop=0) returns row i- read(start=i, stop=i) returns no rows
- read(start=i, stop=i+n) returns rows[i..i+n-1]
The apparent intention is to replicate the underlying behaviour of PyTables? which uses stop=None to indicate one row should be returned. However, in OMERO.tables stop=0 is treated as stop=None which breaks the standard way of specifying Python ranges.
Change History (23)
comment:1 Changed 11 years ago by spli
- Owner set to spli
- References changed from #9944 to 9944
comment:2 Changed 11 years ago by spli
- Description modified (diff)
- References 9944 deleted
comment:3 Changed 11 years ago by spli
- Description modified (diff)
comment:4 Changed 11 years ago by spli
- Milestone changed from Unscheduled to OMERO-4.5
- Remaining Time set to 0.2
- Sprint set to 2012-12-18 (3)
- Status changed from new to accepted
comment:5 Changed 11 years ago by jburel
- Sprint changed from 2012-12-18 (3) to 2013-01-15 (4)
Moved from sprint 2012-12-18 (3)
comment:6 Changed 11 years ago by spli
- Description modified (diff)
comment:7 Changed 11 years ago by jburel
- Sprint changed from 2013-01-15 (4) to 2013-02-12 (5)
Moved from sprint 2013-01-15 (4)
comment:8 Changed 11 years ago by jburel
- Sprint changed from 2013-02-12 (5) to 2013-03-12 (6))
Moved from sprint 2013-02-12 (5)
comment:9 Changed 11 years ago by spli
- Sprint 2013-03-12 (6)) deleted
Does anyone have thoughts on this? The behaviour of stop=0 is inconsistent, both within OMERO.tables and with respect to the general Python range semantics (start..stop-1).
The options I can think of are:
- start=0,stop=0 returns all rows (should start>0,stop=0 return all rows beginning from start?)
- Treat as a Python range so start=0,stop=0 returns no rows
The current implementation corresponds to neither of these. Personally I prefer the latter in keeping with the Python range specifications (and C++ STL container iterators)
comment:10 Changed 11 years ago by jmoore
This is largely the by-product of not being able to pass None via Ice without using an RLong. I'd have to check the git history, but I would have thought start=0,stop=0 should return all rows as a workaround for the passing of None. At some point, this may have been broken.
However, since it's broken at the moment, there's an opportunity to redefine it. I agree that proper Python semantics would be cleaner, but under what conditions do you think someone would pass start=0,stop=0 and want no rows?
comment:11 Changed 10 years ago by spli
- Milestone changed from 5.x to 5.1.0
- Version set to 5.0.2
comment:12 Changed 9 years ago by spli
- Cc cneves added
From #11478
Not sure where this should be handled, if at all, but passing stop=-1 to getWhereList effectively works as stop=numberofrows-1, making the search over the full dataset minus the last row.
comment:13 Changed 9 years ago by spli
My current feeling is to aim for "no special cases" instead of something Python specific.
comment:14 Changed 9 years ago by spli
- Cc ctrueden jamoore added
From #12249
tables.addDataLength() -- sadly forgotten what this was intended for. Curtis?
read(..., BiggerThanSize?) shouldn't throw
read(null, ....) should return all columns
comment:15 Changed 9 years ago by jamoore
- Milestone changed from 5.1.4 to OMERO-5.1.4
Splitting 5.1.4 due to milestone decoupling
comment:16 Changed 9 years ago by jburel
- Milestone changed from OMERO-5.1.4 to OMERO-5.2.0
Discussed with Simon,moving to 5.2 (to be in synch with trello board)
comment:17 Changed 8 years ago by jburel
- Milestone changed from OMERO-5.2.1 to OMERO-5.2.2
Milestone OMERO-5.2.1 deleted
comment:18 Changed 8 years ago by jburel
- Milestone changed from OMERO-5.2.2 to OMERO-5.2.1
Milestone OMERO-5.2.2 deleted
comment:19 Changed 8 years ago by jamoore
Referencing ticket #10084 has changed sprint.
comment:20 Changed 8 years ago by jamoore
Referencing ticket #10084 has changed sprint.
comment:21 Changed 8 years ago by jburel
- Milestone changed from OMERO-5.2.2 to Metadata
comment:22 Changed 8 years ago by jburel
Referencing ticket #9944 has changed sprint.
comment:23 Changed 8 years ago by jburel
Referencing ticket #9944 has changed sprint.
See also #4000 and https://www.openmicroscopy.org/community/viewtopic.php?f=6&t=600