diff --git a/podaac/subsetter/subset_harmony.py b/podaac/subsetter/subset_harmony.py index c5f8a20a..35d1775a 100644 --- a/podaac/subsetter/subset_harmony.py +++ b/podaac/subsetter/subset_harmony.py @@ -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 @@ -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 @@ -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. @@ -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") diff --git a/poetry.lock b/poetry.lock index dfe2bce5..67761d28 100644 --- a/poetry.lock +++ b/poetry.lock @@ -971,26 +971,26 @@ numpy = ">=1.19.3" [[package]] name = "harmony-service-lib" -version = "1.1.0" +version = "2.0.0" description = "A library for Python-based Harmony services to parse incoming message, fetch data, stage data, and call back to Harmony." optional = true python-versions = ">=3.8" files = [ - {file = "harmony_service_lib-1.1.0-py3-none-any.whl", hash = "sha256:7c43f3607b3179b2b9a492d35b63a360bcd521f41ac738839a48db014a6de093"}, - {file = "harmony_service_lib-1.1.0.tar.gz", hash = "sha256:7caa075166386b001765f841c57928b1c6f1fdad2f7f19dc4c1b2e8a6309b8a2"}, + {file = "harmony_service_lib-2.0.0-py3-none-any.whl", hash = "sha256:cca25f82f5086e2442a2dff488d21e1b40d032bfabce54437095f9268bc651a7"}, + {file = "harmony_service_lib-2.0.0.tar.gz", hash = "sha256:68b998843b4e86cf91be67d3ee0102005fb38a5691cbd8cd02ba51416dbbd43a"}, ] [package.dependencies] boto3 = ">=1.14,<2.0" deprecation = ">=2.1.0,<2.2.0" pynacl = ">=1.4,<2.0" -pystac = ">=0.5.3,<0.6.0" +pystac = ">=1.0.0" python-json-logger = ">=2.0.1,<2.1.0" requests = ">=2.24,<3.0" urllib3 = ">=1.26.9,<1.27.0" [package.extras] -dev = ["Faker (>=8.1.3,<8.2.0)", "autopep8 (>=1.5,<2.0)", "debugpy (>=1.2,<2.0)", "flake8 (>=5.0.4,<5.1.0)", "ipython (>=8.10.0,<8.11.0)", "jedi (>=0.17.2,<0.18.0)", "packaging (>=24.1,<25.0)", "parameterized (>=0.7,<1.0)", "pycodestyle (>=2.9.1,<2.10.0)", "pytest (>=7.2.0,<7.3.0)", "pytest-cov (>=2.11,<3.0)", "pytest-mock (>=3.5,<4.0)", "python-language-server (>=0.35,<1.0)", "responses (>=0.22.0,<0.23.0)", "safety (>=3.2.7,<3.3.0)", "setuptools (==70.0.0)"] +dev = ["Faker (>=8.1.3,<8.2.0)", "autopep8 (>=1.5,<2.0)", "debugpy (>=1.2,<2.0)", "flake8 (>=6.1.0)", "ipython (>=8.10.0,<8.11.0)", "jedi (>=0.17.2,<0.18.0)", "packaging (>=24.1,<25.0)", "parameterized (>=0.7,<1.0)", "pycodestyle (>=2.9.1)", "pytest (>=7.2.0,<7.3.0)", "pytest-cov (>=2.11,<3.0)", "pytest-mock (>=3.5,<4.0)", "python-language-server (>=0.35,<1.0)", "responses (>=0.22.0,<0.23.0)", "safety (>=3.2.7,<3.3.0)", "setuptools (==70.0.0)"] [[package]] name = "idna" @@ -1985,20 +1985,23 @@ certifi = "*" [[package]] name = "pystac" -version = "0.5.6" -description = "Python library for working with Spatiotemporal Asset Catalog (STAC)." +version = "1.11.0" +description = "Python library for working with the SpatioTemporal Asset Catalog (STAC) specification" optional = true -python-versions = "*" +python-versions = ">=3.10" files = [ - {file = "pystac-0.5.6-py3-none-any.whl", hash = "sha256:3dfb9068169570714276e54a80832e555a136595a4d5316e6998bcc55cc2d639"}, - {file = "pystac-0.5.6.tar.gz", hash = "sha256:ee0da32e65e93b240dcdcf68f5a16fa2f3f9e937477161f574b04fc48682e84a"}, + {file = "pystac-1.11.0-py3-none-any.whl", hash = "sha256:10ac7c7b4ea6c5ec8333829a09ec1a33b596f02d1a97ffbbd72cd1b6c10598c1"}, + {file = "pystac-1.11.0.tar.gz", hash = "sha256:acb1e04be398a0cda2d8870ab5e90457783a8014a206590233171d8b2ae0d9e7"}, ] [package.dependencies] python-dateutil = ">=2.7.0" [package.extras] -validation = ["jsonschema (==3.2.0)"] +jinja2 = ["jinja2 (<4.0)"] +orjson = ["orjson (>=3.5)"] +urllib3 = ["urllib3 (>=1.26)"] +validation = ["jsonschema (>=4.18,<5.0)"] [[package]] name = "pytest" @@ -2832,4 +2835,4 @@ harmony = ["harmony-service-lib", "pystac"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "f3ce22c899ca149b33ddf139dea8ae813717c8f092542b2020c53597d962bcbb" +content-hash = "d3aac640ba33a2f8ef59db2d3441613a19e70c9e68c3da9026d986cdde672ea3" diff --git a/pyproject.toml b/pyproject.toml index 3ecafced..9fb14930 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/tests/test_subset_harmony.py b/tests/test_subset_harmony.py index 11268a74..6d8e3ee4 100644 --- a/tests/test_subset_harmony.py +++ b/tests/test_subset_harmony.py @@ -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()