Skip to content

Commit

Permalink
Feature/issue 117 improve name of output file (#121)
Browse files Browse the repository at this point in the history
* update poetry.lock

* typo

* modify filename to include first url's name and last datetime

* remove surplus lines

* update CHANGELOG.md

* fix failing test to match new output name

* debug commit

* unquote symbols in time string

* fix failing test

* debug

* debug

* remove debug lines

* change from isoformat extended to basic, and remove url parsing in test

* match timestamp format in test

* fix invalid nested string quotes
  • Loading branch information
danielfromearth authored Nov 14, 2024
1 parent ea3a3dd commit 0c52464
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 129 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Update Github Actions
- Added harmony deployment into github actions.
### Changed
- [issue #117](https://github.com/podaac/concise/issues/117): Add part of URL to output file name
### Deprecated
### Removed
### Fixed
Expand Down
9 changes: 6 additions & 3 deletions podaac/merger/harmony/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def invoke(self):
Primary entrypoint into the service wrapper. Overrides BaseHarmonyAdapter.invoke
"""
if not self.catalog:
# Message-only support is being depreciated in Harmony so we should expect to
# Message-only support is being depreciated in Harmony, so we should expect to
# only see requests with catalogs when invoked with a newer Harmony instance
# https://github.com/nasa/harmony-service-lib-py/blob/21bcfbda17caf626fb14d2ac4f8673be9726b549/harmony/adapter.py#L71
raise RuntimeError('Invoking CONCISE without a STAC catalog is not supported')
Expand All @@ -42,7 +42,7 @@ def invoke(self):
def process_catalog(self, catalog: Catalog):
"""
Recursively process a catalog and all its children. Adapted from
BaseHarmonyAdapter._process_catalog_recursive to specfifically
BaseHarmonyAdapter._process_catalog_recursive to specifically
support our particular use case for many-to-one
Parameters
Expand Down Expand Up @@ -85,7 +85,10 @@ def process_catalog(self, catalog: Catalog):

# -- Perform merging --
collection = self._get_item_source(items[0]).collection
filename = f'{collection}_merged.nc4'
first_granule_url = []
get_granule_url(items[0], first_granule_url)
first_url_name = Path(first_granule_url[0]).stem
filename = f'{first_url_name}_{datetimes[1].strftime("%Y%m%dT%H%M%SZ")}_{collection}_merged.nc4'

with TemporaryDirectory() as temp_dir:
self.logger.info('Starting granule downloads')
Expand Down
Loading

0 comments on commit 0c52464

Please sign in to comment.