Skip to content

Commit

Permalink
update harmony library
Browse files Browse the repository at this point in the history
  • Loading branch information
sliu008 committed Oct 3, 2024
1 parent ff3eb5a commit dc2f0cd
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 24 deletions.
18 changes: 9 additions & 9 deletions podaac/subsetter/subset_harmony.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
import pystac
from pystac import Asset

import harmony
import harmony_service_lib
import numpy as np
from harmony import BaseHarmonyAdapter
from harmony.util import download, stage, generate_output_filename, bbox_to_geometry
from harmony.exceptions import HarmonyException
from harmony_service_lib import BaseHarmonyAdapter
from harmony_service_lib.util import download, stage, generate_output_filename, bbox_to_geometry
from harmony_service_lib.exceptions import HarmonyException

from podaac.subsetter import subset
from podaac.subsetter.subset import SERVICE_NAME
Expand Down Expand Up @@ -111,7 +111,7 @@ def __init__(self, message, catalog=None, config=None):

self.data_dir = os.getenv(DATA_DIRECTORY_ENV, '/home/dockeruser/data')

def process_item(self, item: pystac.Item, source: harmony.message.Source) -> pystac.Item:
def process_item(self, item: pystac.Item, source: harmony_service_lib.message.Source) -> pystac.Item:
"""
Performs variable and bounding box subsetting on the input STAC Item's data, returning
an output STAC item
Expand Down Expand Up @@ -264,7 +264,7 @@ def cmd(self, *args) -> List[str]:
return result_str.split("\n")


def main(config: harmony.util.Config = None) -> None:
def main(config: harmony_service_lib.util.Config = None) -> None:
"""Parse command line arguments and invoke the service to respond to
them.
Expand All @@ -278,10 +278,10 @@ def main(config: harmony.util.Config = None) -> None:
"""
parser = argparse.ArgumentParser(prog=SERVICE_NAME,
description='Run the l2_subsetter service')
harmony.setup_cli(parser)
harmony_service_lib.setup_cli(parser)
args = parser.parse_args()
if harmony.is_harmony_cli(args):
harmony.run_cli(parser, args, L2SubsetterService, cfg=config)
if harmony_service_lib.is_harmony_cli(args):
harmony_service_lib.run_cli(parser, args, L2SubsetterService, cfg=config)
else:
parser.error("Only --harmony CLIs are supported")

Expand Down
27 changes: 15 additions & 12 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ netCDF4 = "^1.5"
xarray = {version = "*", extras = ["parallel"]}
geopandas ="^0.14.1"
Shapely = "^2.0.2"
harmony-service-lib = { version = "^1.0.27", optional = true }
pystac = { version = "^0.5.3", optional = true }
harmony-service-lib = { version = "^2.0.0", optional = true }
pystac = { version = "^1.10.1", optional = true }
julian = "^0.14"
importlib-metadata = "^8.2.0"
h5py = "^3.6.0"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_subset_harmony.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

import podaac.subsetter
from podaac.subsetter.subset_harmony import L2SubsetterService
from harmony.util import config
from harmony_service_lib.util import config


@pytest.fixture()
Expand Down

0 comments on commit dc2f0cd

Please sign in to comment.