Skip to content
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

237 increase page size #239

Merged
merged 6 commits into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ order by last name) and are considered "The icepyx Developers":
* `Jessica Scheick <https://github.com/jessicas11>`_ - Unaffiliated (ORCID: `0000-0002-3421-4459 <https://www.orcid.org/0000-0002-3421-4459>`_)
* `David Shean <https://github.com/dshean>`_ - University of Washington
* `Ben Smith <https://github.com/smithb>`_ - University of Washington
* `Trey Stafford <https://github.com/trey-stafford>`_ - NSIDC, University of Colorado
* `Amy Steiker <https://github.com/asteiker>`_ - NSIDC, University of Colorado
* `Tyler Sutterley <https://github.com/tsutterley>`_ - University of Washington
* `Anna Valentine <https://github.com/annavalentine>`_ - Colorado School of Mines
Expand Down
2 changes: 1 addition & 1 deletion examples/ICESat-2_DAAC_DataAccess_Example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@
"metadata": {},
"source": [
"Once we have generated our session, we must build the required configuration parameters needed to actually download data. These will tell the system how we want to download the data. As with the CMR search parameters, these will be built automatically when you run `region_a.order_granules()`, but you can also create and view them with `region_a.reqparams`. The default parameters, given below, should work for most users.\n",
"- `page_size` = 10. This is the number of granules we will request per order.\n",
"- `page_size` = 2000. This is the number of granules we will request per order.\n",
"- `page_num` = 1. Determine the number of pages based on page size and the number of granules available. If no page_num is specified, this calculation is done automatically to set page_num, which then provides the number of individual orders we will request given the number of granules.\n",
"- `request_mode` = 'async'\n",
"- `agent` = 'NO'\n",
Expand Down
10 changes: 5 additions & 5 deletions icepyx/core/APIformatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,13 @@ def combine_params(*param_dicts):
Examples
--------
>>> CMRparams = {'short_name': 'ATL06', 'version': '002', 'temporal': '2019-02-20T00:00:00Z,2019-02-28T23:59:59Z', 'bounding_box': '-55,68,-48,71'}
>>> reqparams = {'page_size': 10, 'page_num': 1}
>>> reqparams = {'page_size': 2000, 'page_num': 1}
>>> icepyx.core.APIformatting.combine_params(CMRparams, reqparams)
{'short_name': 'ATL06',
'version': '002',
'temporal': '2019-02-20T00:00:00Z,2019-02-28T23:59:59Z',
'bounding_box': '-55,68,-48,71',
'page_size': 10,
'page_size': 2000,
'page_num': 1}
"""
params = {}
Expand All @@ -223,10 +223,10 @@ def to_string(params):
Examples
--------
>>> CMRparams = {'short_name': 'ATL06', 'version': '002', 'temporal': '2019-02-20T00:00:00Z,2019-02-28T23:59:59Z', 'bounding_box': '-55,68,-48,71'}
>>> reqparams = {'page_size': 10, 'page_num': 1}
>>> reqparams = {'page_size': 2000, 'page_num': 1}
>>> params = icepyx.core.APIformatting.combine_params(CMRparams, reqparams)
>>> icepyx.core.APIformatting.to_string(params)
'short_name=ATL06&version=002&temporal=2019-02-20T00:00:00Z,2019-02-28T23:59:59Z&bounding_box=-55,68,-48,71&page_size=10&page_num=1'
'short_name=ATL06&version=002&temporal=2019-02-20T00:00:00Z,2019-02-28T23:59:59Z&bounding_box=-55,68,-48,71&page_size=2000&page_num=1'
"""
param_list = []
for k, v in params.items():
Expand Down Expand Up @@ -441,7 +441,7 @@ def build_params(self, **kwargs):
else:
reqkeys = self.poss_keys[self._reqtype]
defaults = {
"page_size": 10,
"page_size": 2000,
"page_num": 1,
"request_mode": "async",
"include_meta": "Y",
Expand Down
4 changes: 2 additions & 2 deletions icepyx/core/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,14 +387,14 @@ def reqparams(self):
--------
>>> reg_a = icepyx.query.Query('ATL06',[-55, 68, -48, 71],['2019-02-20','2019-02-28'])
>>> reg_a.reqparams
{'page_size': 10, 'page_num': 1}
{'page_size': 2000, 'page_num': 1}

>>> reg_a = icepyx.query.Query('ATL06',[-55, 68, -48, 71],['2019-02-20','2019-02-28'])
>>> reg_a.earthdata_login(user_id,user_email)
Earthdata Login password: ········
>>> reg_a.order_granules()
>>> reg_a.reqparams
{'page_size': 10, 'page_num': 1, 'request_mode': 'async', 'include_meta': 'Y', 'client_string': 'icepyx'}
{'page_size': 2000, 'page_num': 1, 'request_mode': 'async', 'include_meta': 'Y', 'client_string': 'icepyx'}
"""

if not hasattr(self, "_reqparams"):
Expand Down
4 changes: 2 additions & 2 deletions icepyx/tests/test_APIformatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,13 +1052,13 @@ def test_to_string():
"temporal": "2019-02-20T00:00:00Z,2019-02-28T23:59:59Z",
"bounding_box": "-55,68,-48,71",
}
reqparams = {"page_size": 10, "page_num": 1}
reqparams = {"page_size": 2000, "page_num": 1}
params = apifmt.combine_params(CMRparams, reqparams)
obs = apifmt.to_string(params)
expected = (
"short_name=ATL06&version=002"
"&temporal=2019-02-20T00:00:00Z,2019-02-28T23:59:59Z"
"&bounding_box=-55,68,-48,71&page_size=10&page_num=1"
"&bounding_box=-55,68,-48,71&page_size=2000&page_num=1"
)
assert obs == expected

Expand Down