Skip to content

Commit

Permalink
HARMONY-1949: Additional cleanup of documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-durbin committed Nov 11, 2024
1 parent 6b572fe commit 043e042
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ interop and upgrades. To work with Harmony, services must:
supported way to receive messages, though HTTP is likely to follow. `harmony.cli`
provides helpers for setting up CLI parsing while being unobtrusive to non-Harmony
CLIs that may also need to exist.
2. Extend `harmony.BaseHarmonyAdapter` and implement the `#invoke` to
adapt the incoming Harmony message to a service call and adapt the service
result to call to one of the adapter's `#completed_with_*` methods. The adapter
class provides helper methods for retrieving data, staging results, and cleaning
up temporary files, though these can be overridden or ignored if a service
needs different behavior, e.g. if it operates on data in situ and does not
want to download the remote file.
2. Extend `harmony.BaseHarmonyAdapter` and either override `#invoke` to process
the message or override `#process_item` to process each individual STAC item
provided in the input STAC catalog. The adapter class provides helper methods
for retrieving data, staging results, and cleaning up temporary files, though
these can be overridden or ignored if a service needs different behavior, e.g.
if it operates on data in situ and does not want to download the remote file.

A full example of these two requirements with use of helpers can be found in
[example/example_service.py](example/example_service.py). Also see
Expand Down
4 changes: 1 addition & 3 deletions harmony_service_lib/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,9 +582,7 @@ class Message(JsonObject):
version : string
The semantic version of the Harmony message contained in the provided JSON
callback : string
The URL that services must POST to when their execution is complete. Services
should use the `completed_with_*` methods of a Harmony Adapter to perform
callbacks to ensure compatibility, rather than directly using this URL
(Deprecated) The URL that services must POST to when their execution is complete.
stagingLocation : string
An object store (S3) URL prefix under which services may elect to put their output.
Services must have write access to the Harmony staging bucket for the deployed
Expand Down
3 changes: 0 additions & 3 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ def __init__(self, message, catalog=None):
def invoke(self):
return (self.message, self.result_catalog)

def completed_with_error(self, error):
MockAdapter.errors.append(error)

def cleanup(self):
MockAdapter.cleaned_up.append(True)

Expand Down

0 comments on commit 043e042

Please sign in to comment.