Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #7 from cirrus-geo/develop
Browse files Browse the repository at this point in the history
publish 0.3.1
  • Loading branch information
matthewhanson authored Sep 28, 2020
2 parents dbc17b3 + 71fa0f0 commit 408261f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [v0.3.1] - 2020-09-27

### Changed
- output_options->collections is now optional, if not provided than item collections are not updated

### Fixed
- `process` function will reraise any error occuring while setting up processing so can be retried with redrivepolicy

## [v0.3.0] - 2020-09-02

### Changed
Expand Down Expand Up @@ -49,6 +57,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
Initial Release

[Unreleased]: https://github.com/cirrus-geo/cirrus-lib/compare/master...develop
[v0.3.1]: https://github.com/cirrus-geo/cirrus-lib/compare/v0.3.0...v0.3.1
[v0.3.0]: https://github.com/cirrus-geo/cirrus-lib/compare/v0.2.1...v0.3.0
[v0.2.1]: https://github.com/cirrus-geo/cirrus-lib/compare/v0.2.0...v0.2.1
[v0.2.0]: https://github.com/cirrus-geo/cirrus-lib/compare/v0.1.3...v0.2.0
Expand Down
6 changes: 4 additions & 2 deletions cirruslib/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def __init__(self, *args, update=False, state_item=None, **kwargs):
assert(self['type'] == 'FeatureCollection')
assert('process' in self)
assert('output_options' in self['process'])
assert('collections' in self['process']['output_options'])
assert('workflow' in self['process'])
assert('tasks' in self['process'])
assert('workflow-' in self['id'])
Expand Down Expand Up @@ -90,8 +89,10 @@ def assign_collections(self):
"""Assign new collections to all Items (features) in Catalog
based on self['process']['output_options']['collections']
"""
collections = self['process']['output_options']['collections']
collections = self['process']['output_options'].get('collections', {})
# loop through all Items in Catalog
for item in self['features']:
# loop through all provided output collections regexs
for col in collections:
regex = re.compile(collections[col])
if regex.match(item['id']):
Expand Down Expand Up @@ -247,6 +248,7 @@ def process(self) -> str:
logger.error(msg)
logger.error(format_exc())
statedb.add_failed_item(self, msg)
raise err


class Catalogs(object):
Expand Down
2 changes: 1 addition & 1 deletion cirruslib/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.3.0'
__version__ = '0.3.1'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
version=__version__,
description='Cirrus Library',
url='https://github.com/cirrus-geo/cirrus-lib.git',
license='MIT',
license='Apache-2.0',
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
Expand Down
4 changes: 2 additions & 2 deletions tests/test_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ def test_get_s3_session(self):
assert(buckets['Buckets'][0]['Name'] == testbucket)

def test_download_from_http(self):
url = 'https://raw.githubusercontent.com/matthewhanson/boto3-utils/master/README.md'
url = 'https://raw.githubusercontent.com/cirrus-geo/cirrus/master/README.md'
fname = transfer.download_from_http(url, path=testpath)
assert(os.path.exists(fname))
with open(fname) as f:
lines = f.readlines()
assert('boto3-utils') in lines[-1]
assert('Cirrus') in lines[0]

def test_download_item_assets(self):
item = self.get_test_item()
Expand Down

0 comments on commit 408261f

Please sign in to comment.