-
Notifications
You must be signed in to change notification settings - Fork 109
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
use Cmr-search-after instead of paging #87
Conversation
Should be using reg_a.granules.avail instead of reg_a.granules
Reformat CONTRIBUTORS.rst, add myself, fix typo
Better to not depend on 'page_num' from previous query (especially since using scrolling now)
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov Report
@@ Coverage Diff @@
## development #87 +/- ##
============================================
Coverage 55.45% 55.45%
============================================
Files 28 28
Lines 1951 1960 +9
Branches 404 406 +2
============================================
+ Hits 1082 1087 +5
- Misses 800 804 +4
Partials 69 69
Continue to review full report at Codecov.
|
See #22 (comment) for an update on why the switch from cmr scrolling to cmr-search-after. Note: the PR-linked RTDs build is failing because of a recent pip release combined with the fact that you can't wipe the build environment for PRs. A branch build shows they pass with no issues. |
@betolink Do you think you could review this PR (or recommend someone who can)? |
Hi @JessicaS11 I can take a look this week, maybe Andy would be another person to ask as well. One thing, i.e. this would be an anti-pattern for an initial search: reqparams = {'page_size': 2000, 'page_num': 3} Are the pagination parameters exposed to the users or it's an internal Icepyx interface? As a user I don't really need to access say page 565, usually we just want to know how many granules we get back from CMR and then download them all. The PR Looks good! |
Primarily the latter. With this PR, In general, I tried to design icepyx so that users had 100% control over (and visibility of) any request/parameters being sent to an endpoint if they want it (and to help it map clearly to the CMR docs for programmatic data access), but don't actually have to be bothered with the parameter dictionaries and request syntax/parsing otherwise. |
This PR has been updated to use a cmr-search-after; this review is outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's looking great, there won't be a noticeable performance difference for Icepyx but CMR will handle these big queries better than just using pagination. I'll wait for Andy to take a look before approving it. Great work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR is ready to be merged and tested in the dev branch. Looks like regular pagination and search-after will coexist and will be transparent to the users so that's great.
Unfortunately EGI does not support scrolling yet, so this only updates granule search.
Some thoughts: Ordering and querying could be less coupled than they are now e.g.
place_order
callsget_avail
to know how many granules will be ordered, but the sub-setting service will do the similar search itself to fulfill the order. In some edge cases these two searches can become inconsistent with each other, especially now that one uses scrolling and one uses paging. At the moment it is the only way to know/estimate the number of pages/orders necessary so I left it as is. Maybe long term we want to separate 'querying' functionality from 'ordering' into separate classes or something?