diff --git a/geoglows/__init__.py b/geoglows/__init__.py index fd454ad..2109970 100644 --- a/geoglows/__init__.py +++ b/geoglows/__init__.py @@ -11,6 +11,6 @@ 'bias', 'plots', 'data', 'analyze', 'streams', 'tables', 'METADATA_TABLE_PATH' ] -__version__ = '1.0.2' +__version__ = '1.0.3' __author__ = 'Riley Hales' __license__ = 'BSD 3-Clause Clear License' diff --git a/geoglows/data.py b/geoglows/data.py index 67e4bbb..a9a3ae4 100644 --- a/geoglows/data.py +++ b/geoglows/data.py @@ -60,9 +60,11 @@ def from_aws(*args, **kwargs): else: raise ValueError('Date must be YYYYMMDD or YYYYMMDDHH format. Use dates() to view available data.') else: - dates = sorted([x.split('/')[-1] for x in s3.ls(ODP_FORECAST_S3_BUCKET_URI)]) + dates = sorted([x.split('/')[-1] for x in s3.ls(ODP_FORECAST_S3_BUCKET_URI)], reverse=True) + dates = [x.split('.')[0] for x in dates if x.endswith('.zarr')] # ignore the index.html file + dates = [x.replace('00.zarr', '') for x in dates] if product_name == 'dates': - return dates + return pd.DataFrame(dict(dates=dates)) date = dates[-1] s3store = s3fs.S3Map(root=f'{ODP_FORECAST_S3_BUCKET_URI}/{date}', s3=s3, check=False)