Skip to content

Api wells2#5069

Merged
jburel merged 25 commits intoome:developfrom
will-moore:api_wells2
Feb 28, 2017
Merged

Api wells2#5069
jburel merged 25 commits intoome:developfrom
will-moore:api_wells2

Conversation

@will-moore
Copy link
Copy Markdown
Member

@will-moore will-moore commented Feb 1, 2017

What this PR does

Follow-up PR on listing Wells in Plate, filtering by PlateAcquisition and WellSample Index.
Allows api user to "browse" Plate -> (PlateAcquisition) -> Wells (for single index) as in the client UIs.

  • To discuss: Implementing 'childCount' for Plates should count PlateAcquisitions (as in webclient tree) OR Well_Sample indices, which might be more useful since many Plates have a single PlateAcquisition.

Testing this PR

  • User starts at /plates/. When listing plates we don't include Index counts.
  • Choose a single plate /plates/:id/ which gives min/max WellSample index.
  • Also lists urls for filtering wells by index:
   "url:wellsampleindex_wells": [
         "/plates/:id/wellsampleindex/0/wells/",
         "/plates/:id/wellsampleindex/1/wells/",
         "/plates/:id/wellsampleindex/2/wells/"
       ]
  • To get PlateAcquisitions in the plate, follow link to /plates/:id/plateacquisitions/
  • To get Wells in a particular Index follow link to /plateacquisitions/:id/wellsampleindex/:idx/wells/

When filtering Wells by Index, each WellSample list should have a single item.

@jburel jburel added the develop label Feb 1, 2017
@snoopycrimecop
Copy link
Copy Markdown
Member

Conflicting PR. Removed from build OMERO-DEV-merge-push#580. See the console output for more details.
Possible conflicts:

@snoopycrimecop
Copy link
Copy Markdown
Member

Conflicting PR. Removed from build OMERO-DEV-merge-push#581. See the console output for more details.
Possible conflicts:

@will-moore will-moore closed this Feb 3, 2017
@will-moore will-moore reopened this Feb 20, 2017
@jburel
Copy link
Copy Markdown
Member

jburel commented Feb 21, 2017

./components/tools/OmeroWeb/test/integration/test_api_containers.py:346:30: E225 missing whitespace around operator

"""
query, clauses, params = super(
_PlateAcquisitionWrapper, cls)._getQueryString(opts)
if opts is not None and 'plate' in opts:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe good to have one method to prepare the query for plate filtering
Same check in this method and getName

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry - I'm not sure what you mean here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code like
if 'plate' in opts: clauses.append('obj.plate.id = :pid') params.add('pid', rlong(opts['plate']))

# at /plates/:plate_id/wells/ we have 'plate_id' in kwargs
if 'plate_id' in kwargs:
opts['plate'] = long(kwargs['plate_id'])
elif 'plateacquisition_id' in kwargs:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to allow to filter by plate id and plateacquisition id?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's a case for that, since plateacquisition ID would also define plate ID.

import pytest
from test_api_projects import get_update_service, \
get_connection, marshal_objects
get_connection, marshal_objects, cmp_name_insensitive
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

order.Maybe also one per line


def test_plate_index_wells(self, user1, multi_acquisition_plate):
"""
Test filtering of Wells by Plate/Acquisition AND index.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plate/PlateAcquisition to match the rest

@jburel
Copy link
Copy Markdown
Member

jburel commented Feb 22, 2017

/plates/:id/plateacquisitions/:id/index/:idx/wells/ this is probably an error in the description since it combines plate id and plate acquisition i.e. ````/plates/:id/plateacquisitions/:id`` gives a 404

http://web-dev-merge.openmicroscopy.org/api/v0/m/plateacquisitions/2053/index/2/wells/ this works

http://web-dev-merge.openmicroscopy.org/api/v0/m/wells/338626/ works
We might have a case for limit/MaxLimit and count and offset to handle the case of wells with very large number of fields
e.g. 700 fields from Damir

@will-moore
Copy link
Copy Markdown
Member Author

@jburel Yes, description was wrong. Fixed now.

@will-moore will-moore closed this Feb 23, 2017
@will-moore will-moore reopened this Feb 23, 2017
@will-moore
Copy link
Copy Markdown
Member Author

NB: this is now conflicting with #5067.

@snoopycrimecop
Copy link
Copy Markdown
Member

Conflicting PR. Removed from build OMERO-DEV-merge-push#597. See the console output for more details.
Possible conflicts:

  • PR Api pagination #5067 will-moore 'Api pagination'
    • components/tools/OmeroWeb/omeroweb/api/api_query.py

@will-moore will-moore closed this Feb 24, 2017
@will-moore will-moore reopened this Feb 24, 2017
@will-moore will-moore closed this Feb 26, 2017
@will-moore will-moore reopened this Feb 26, 2017
@will-moore
Copy link
Copy Markdown
Member Author

will-moore commented Feb 27, 2017

@jburel I'm thinking maybe I should use the full term wellsampleindex in these urls instead of index.
E.g. "/plates/:id/wellsampleindex/0/wells/"
Since this provides a clearer idea what the url is giving you.

@jburel
Copy link
Copy Markdown
Member

jburel commented Feb 27, 2017

@will-moore: I think making it more explicit will be better.

api_wells,
api_plate_plateacquisitions,
api_plateacquisition,
api_plateacquisition_index_wells,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will also replace here wellsample_index instead of just index

api_plate_plateacquisitions,
api_plateacquisition,
api_plateacquisition_index_wells,
api_plate_index_wells,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@jburel
Copy link
Copy Markdown
Member

jburel commented Feb 28, 2017

Tests are passing
wellsampleindex is now used e.g. http://web-dev-merge.openmicroscopy.org/api/v0/m/plateacquisitions/2053/wellsampleindex/1/wells/?limit=10&offset=0

@jburel
Copy link
Copy Markdown
Member

jburel commented Feb 28, 2017

Merging

@jburel jburel merged commit c954eb1 into ome:develop Feb 28, 2017
@jburel jburel added this to the 5.3.0 milestone Mar 29, 2017
@will-moore will-moore deleted the api_wells2 branch February 18, 2019 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants