From 119de12fb8fefef44552d5073582944cd7497339 Mon Sep 17 00:00:00 2001 From: Matthew Hanson Date: Thu, 23 Jan 2020 00:01:19 -0500 Subject: [PATCH 1/4] fix typo in CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0906b48..e1ed9e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] -## [v0.3.2] - 2020-01-022 +## [v0.3.2] - 2020-01-22 ### Changed - sat-stac now compatible with Python3 versions < 3.6 () From e5ae5475aed8859a31df04010eb16fb15e33114d Mon Sep 17 00:00:00 2001 From: Matthew Hanson Date: Thu, 23 Jan 2020 01:31:08 -0500 Subject: [PATCH 2/4] make calendar term view configurable by group --- satstac/itemcollection.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/satstac/itemcollection.py b/satstac/itemcollection.py index 859d927..59158c1 100644 --- a/satstac/itemcollection.py +++ b/satstac/itemcollection.py @@ -127,15 +127,15 @@ def summary(self, params=[]): txt += ''.join(['{:<25} '.format(s.substitute('${%s}' % p)) for p in params]) + '\n' return txt - def calendar(self): + def calendar(self, group='platform'): """ Get calendar for dates """ date_labels = {} for d in self.dates(): - sensors = self.properties('eo:platform', d) - if len(sensors) > 1: + groups = self.properties(group, d) + if len(groups) > 1: date_labels[d] = 'Multiple' else: - date_labels[d] = sensors[0] + date_labels[d] = groups[0] return terminal_calendar(date_labels) def save(self, filename): From 60af3860d52e53f26e686863d5a0fb03016596a6 Mon Sep 17 00:00:00 2001 From: Matthew Hanson Date: Thu, 23 Jan 2020 10:24:24 -0500 Subject: [PATCH 3/4] fix spelling of requester pays --- satstac/item.py | 4 ++-- satstac/utils.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/satstac/item.py b/satstac/item.py index 44ded20..e27717b 100644 --- a/satstac/item.py +++ b/satstac/item.py @@ -134,7 +134,7 @@ def download_assets(self, keys=None, **kwargs): filenames.append(self.download(key, **kwargs)) return filenames - def download(self, key, overwrite=False, path='', filename='${id}', requestor_pays=False): + def download(self, key, overwrite=False, path='', filename='${id}', requester_pays=False): """ Download this key (e.g., a band, or metadata file) from the scene """ asset = self.asset(key) if asset is None: @@ -148,7 +148,7 @@ def download(self, key, overwrite=False, path='', filename='${id}', requestor_pa ext = os.path.splitext(asset['href'])[1] fout = os.path.join(_path, fname + '_' + key + ext) if not os.path.exists(fout) or overwrite: - _filename = utils.download_file(asset['href'], filename=fout, requestor_pays=requestor_pays) + _filename = utils.download_file(asset['href'], filename=fout, requester_pays=requester_pays) else: _filename = fout except Exception as e: diff --git a/satstac/utils.py b/satstac/utils.py index 39a713a..5f96d39 100644 --- a/satstac/utils.py +++ b/satstac/utils.py @@ -52,14 +52,14 @@ def dict_merge(dct, merge_dct, add_keys=True): return dct -def download_file(url, filename=None, requestor_pays=False): +def download_file(url, filename=None, requester_pays=False): """ Download a file as filename """ filename = os.path.basename(url) if filename is None else filename logger.info('Downloading %s as %s' % (url, filename)) headers = {} # check if on s3, if so try to sign it if 's3.amazonaws.com' in url: - signed_url, signed_headers = get_s3_signed_url(url, requestor_pays=requestor_pays) + signed_url, signed_headers = get_s3_signed_url(url, requester_pays=requester_pays) resp = requests.get(signed_url, headers=signed_headers, stream=True) if resp.status_code != 200: resp = requests.get(url, headers=headers, stream=True) @@ -98,7 +98,7 @@ def splitall(path): return allparts -def get_s3_signed_url(url, rtype='GET', public=False, requestor_pays=False, content_type=None): +def get_s3_signed_url(url, rtype='GET', public=False, requester_pays=False, content_type=None): access_key = os.environ.get('AWS_BUCKET_ACCESS_KEY_ID', os.environ.get('AWS_ACCESS_KEY_ID')) secret_key = os.environ.get('AWS_BUCKET_SECRET_ACCESS_KEY', os.environ.get('AWS_SECRET_ACCESS_KEY')) region = os.environ.get('AWS_BUCKET_REGION', os.environ.get('AWS_REGION', 'eu-central-1')) @@ -142,7 +142,7 @@ def getSignatureKey(key, dateStamp, regionName, serviceName): 'x-amz-content-sha256': payload_hash, 'x-amz-date': amzdate } - if requestor_pays: + if requester_pays: headers['x-amz-request-payer'] = 'requester' if public: headers['x-amz-acl'] = 'public-read' From 9830b765016b0d0855bd49a32b2e6f177227d2a2 Mon Sep 17 00:00:00 2001 From: Matthew Hanson Date: Thu, 23 Jan 2020 10:26:05 -0500 Subject: [PATCH 4/4] update version and CHANGELOG --- CHANGELOG.md | 6 ++++++ satstac/version.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1ed9e9..d98d519 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [v0.3.3] - 2020-01-23 + +### Fixed +- Spelling of requester pays (was requestor) + ## [v0.3.2] - 2020-01-22 ### Changed @@ -74,6 +79,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. Initial Release [Unreleased]: https://github.com/sat-utils/sat-stac/compare/master...develop +[v0.3.3]: https://github.com/sat-utils/sat-stac/compare/0.3.2...v0.3.3 [v0.3.2]: https://github.com/sat-utils/sat-stac/compare/0.3.1...v0.3.2 [v0.3.1]: https://github.com/sat-utils/sat-stac/compare/0.3.0...v0.3.1 [v0.3.0]: https://github.com/sat-utils/sat-stac/compare/0.2.0...v0.3.0 diff --git a/satstac/version.py b/satstac/version.py index 73e3bb4..80eb7f9 100644 --- a/satstac/version.py +++ b/satstac/version.py @@ -1 +1 @@ -__version__ = '0.3.2' +__version__ = '0.3.3'