Skip to content

Commit 789a9a4

Browse files
authored
Merge pull request #88 from andrewdelman/ecco_access_fsspec
edits to function headers and arguments order
2 parents ce55c17 + ae33a21 commit 789a9a4

File tree

3 files changed

+25
-33
lines changed

3 files changed

+25
-33
lines changed

ecco_access/ecco_access.py

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ def ecco_podaac_access(query,version='v4r4',grid=None,time_res='all',\
124124
125125
Returns
126126
-------
127-
download_files: dict, with keys: ShortNames and values:
128-
URLs (if in 'query' mode), or paths of files that can be
129-
passed directly to xarray (open_dataset or open_mfdataset).
130-
Values are of type str if query finds only one granule/file
131-
for that ShortName; of type list if query finds
132-
multiple granules in the same dataset;
133-
or of type fsspec.mapping.FSMap if mode = 's3_open_fsspec'.
134-
Only returned if return_granules=True (default).
127+
granule_files: dict with ShortNames as keys; values are URLs or S3 paths
128+
(if in 'query' mode), or paths of files that can be
129+
passed directly to xarray (open_dataset or open_mfdataset).
130+
Values are of type str if query finds only one granule/file
131+
for that ShortName; of type list if query finds
132+
multiple granules in the same dataset;
133+
or of type fsspec.mapping.FSMap if mode = 's3_open_fsspec'.
134+
Only returned if return_granules=True (default).
135135
136136
"""
137137

@@ -272,6 +272,7 @@ def shortnames_find(query_list,grid,time_res):
272272
###================================================================================================================
273273

274274

275+
275276
def ecco_podaac_to_xrdataset(query,version='v4r4',grid=None,time_res='all',\
276277
StartDate=None,EndDate=None,snapshot_interval=None,\
277278
mode='download_ifspace',download_root_dir=None,**kwargs):
@@ -325,10 +326,6 @@ def ecco_podaac_to_xrdataset(query,version='v4r4',grid=None,time_res='all',\
325326
and 'monthly' otherwise.
326327
327328
mode: str, one of the following:
328-
'ls' or 'query': Query dataset ShortNames and variable names/
329-
descriptions only; no downloads.
330-
's3_ls' or 's3_query': Query dataset ShortNames and variable names/
331-
descriptions only; return paths on S3.
332329
'download': Download datasets using NASA Earthdata URLs
333330
'download_ifspace': Check storage availability before downloading.
334331
Download only if storage footprint of downloads
@@ -375,16 +372,11 @@ def ecco_podaac_to_xrdataset(query,version='v4r4',grid=None,time_res='all',\
375372
force_redownload: bool, if True, existing files will be redownloaded and replaced;
376373
if False (default), existing files will not be replaced.
377374
378-
return_granules: bool, if True (default), str or list of queried or
379-
downloaded granules/files (including ones that
380-
were already on disk and not replaced) is returned.
381-
if False, the function returns nothing.
382-
383375
Returns
384376
-------
385377
ds_out: xarray Dataset or dict of xarray Datasets (with ShortNames as keys),
386378
containing all of the accessed datasets.
387-
Does not work with the query modes: 'ls','query','s3_ls','s3_query'.
379+
This function does not work with the query modes: 'ls','query','s3_ls','s3_query'.
388380
"""
389381

390382
pass

ecco_access/ecco_download.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@ def ecco_podaac_download(ShortName,StartDate,EndDate,snapshot_interval='monthly'
383383
###================================================================================================================
384384

385385

386-
def ecco_podaac_download_diskaware(ShortNames,StartDate,EndDate,max_avail_frac=0.5,snapshot_interval=None,\
387-
download_root_dir=None,n_workers=6,force_redownload=False):
386+
def ecco_podaac_download_diskaware(ShortNames,StartDate,EndDate,snapshot_interval=None,\
387+
download_root_dir=None,max_avail_frac=0.5,n_workers=6,force_redownload=False):
388388

389389
"""
390390
@@ -405,11 +405,6 @@ def ecco_podaac_download_diskaware(ShortNames,StartDate,EndDate,max_avail_frac=0
405405
ECCOv4r4 date range is '1992-01-01' to '2017-12-31'.
406406
For 'SNAPSHOT' datasets, an additional day is added to EndDate to enable closed budgets
407407
within the specified date range.
408-
409-
max_avail_frac: float, maximum fraction of remaining available disk space to use in storing current ECCO datasets.
410-
If storing the datasets exceeds this fraction, an error is returned.
411-
Valid range is [0,0.9]. If number provided is outside this range, it is replaced by the closer
412-
endpoint of the range.
413408
414409
snapshot_interval: ('monthly', 'daily', or None), if snapshot datasets are included in ShortNames,
415410
this determines whether snapshots are included for only the beginning/end of each month
@@ -420,6 +415,11 @@ def ecco_podaac_download_diskaware(ShortNames,StartDate,EndDate,max_avail_frac=0
420415
download_root_dir: str, defines parent directory to download files to.
421416
Files will be downloaded to directory download_root_dir/ShortName/.
422417
If not specified, parent directory defaults to '~/Downloads/ECCO_V4r4_PODAAC/'.
418+
419+
max_avail_frac: float, maximum fraction of remaining available disk space to use in storing current ECCO datasets.
420+
If storing the datasets exceeds this fraction, an error is returned.
421+
Valid range is [0,0.9]. If number provided is outside this range, it is replaced by the closer
422+
endpoint of the range.
423423
424424
n_workers: int, number of workers to use in concurrent downloads. Benefits typically taper off above 5-6.
425425
Applies only if files are downloaded.

ecco_access/ecco_s3_retrieve.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,8 @@ def ecco_podaac_s3_get(ShortName,StartDate,EndDate,snapshot_interval='monthly',d
527527
###================================================================================================================
528528

529529

530-
def ecco_podaac_s3_get_diskaware(ShortNames,StartDate,EndDate,max_avail_frac=0.5,snapshot_interval=None,\
531-
download_root_dir=None,n_workers=6,force_redownload=False):
530+
def ecco_podaac_s3_get_diskaware(ShortNames,StartDate,EndDate,snapshot_interval=None,\
531+
download_root_dir=None,max_avail_frac=0.5,n_workers=6,force_redownload=False):
532532

533533
"""
534534
@@ -551,12 +551,7 @@ def ecco_podaac_s3_get_diskaware(ShortNames,StartDate,EndDate,max_avail_frac=0.5
551551
ECCOv4r4 date range is '1992-01-01' to '2017-12-31'.
552552
For 'SNAPSHOT' datasets, an additional day is added to EndDate to enable closed budgets
553553
within the specified date range.
554-
555-
max_avail_frac: float, maximum fraction of remaining available disk space to use in storing current ECCO datasets.
556-
This determines whether the dataset files are stored on the current instance, or opened on S3.
557-
Valid range is [0,0.9]. If number provided is outside this range, it is replaced by the closer
558-
endpoint of the range.
559-
554+
560555
snapshot_interval: ('monthly', 'daily', or None), if snapshot datasets are included in ShortNames,
561556
this determines whether snapshots are included for only the beginning/end of each month
562557
('monthly'), or for every day ('daily').
@@ -567,6 +562,11 @@ def ecco_podaac_s3_get_diskaware(ShortNames,StartDate,EndDate,max_avail_frac=0.5
567562
Files will be downloaded to directory download_root_dir/ShortName/.
568563
If not specified, parent directory defaults to '~/Downloads/ECCO_V4r4_PODAAC/'.
569564
565+
max_avail_frac: float, maximum fraction of remaining available disk space to use in storing current ECCO datasets.
566+
This determines whether the dataset files are stored on the current instance, or opened on S3.
567+
Valid range is [0,0.9]. If number provided is outside this range, it is replaced by the closer
568+
endpoint of the range.
569+
570570
n_workers: int, number of workers to use in concurrent downloads. Benefits typically taper off above 5-6.
571571
Applies only if files are downloaded.
572572

0 commit comments

Comments
 (0)