diff --git a/docs/HyBIG-Example-Usage.ipynb b/docs/HyBIG-Example-Usage.ipynb index b0d3939..313c7b0 100644 --- a/docs/HyBIG-Example-Usage.ipynb +++ b/docs/HyBIG-Example-Usage.ipynb @@ -57,7 +57,7 @@ "metadata": {}, "outputs": [], "source": [ - "from harmony import Collection, Environment, Client, Request\n", + "from harmony_service_lib import Collection, Environment, Client, Request\n", "\n", "# creates an output directory for the downloaded files\n", "from pathlib import Path\n", diff --git a/harmony_service/__main__.py b/harmony_service/__main__.py index 5188729..79e94a8 100644 --- a/harmony_service/__main__.py +++ b/harmony_service/__main__.py @@ -3,7 +3,7 @@ from argparse import ArgumentParser from sys import argv -from harmony import is_harmony_cli, run_cli, setup_cli +from harmony_service_lib import is_harmony_cli, run_cli, setup_cli from .adapter import BrowseImageGeneratorAdapter from .exceptions import SERVICE_NAME diff --git a/harmony_service/adapter.py b/harmony_service/adapter.py index 0f4700a..89b66f4 100644 --- a/harmony_service/adapter.py +++ b/harmony_service/adapter.py @@ -12,15 +12,20 @@ from shutil import rmtree from tempfile import mkdtemp -from harmony import BaseHarmonyAdapter -from harmony.message import Source as HarmonySource -from harmony.message_utility import ( +from harmony_service_lib import BaseHarmonyAdapter +from harmony_service_lib.message import Source as HarmonySource +from harmony_service_lib.message_utility import ( has_crs, has_scale_extents, has_scale_sizes, has_valid_scale_extents, ) -from harmony.util import bbox_to_geometry, download, generate_output_filename, stage +from harmony_service_lib.util import ( + bbox_to_geometry, + download, + generate_output_filename, + stage, +) from pystac import Asset, Catalog, Item from harmony_service.exceptions import HyBIGInvalidMessageError, HyBIGServiceError diff --git a/harmony_service/exceptions.py b/harmony_service/exceptions.py index 245f177..8414914 100644 --- a/harmony_service/exceptions.py +++ b/harmony_service/exceptions.py @@ -1,6 +1,6 @@ """Module defining harmony service errors raised by HyBIG service.""" -from harmony.util import HarmonyException +from harmony_service_lib.util import HarmonyException SERVICE_NAME = 'harmony-browse-image-generator' diff --git a/hybig/browse.py b/hybig/browse.py index dedac30..c0deef7 100644 --- a/hybig/browse.py +++ b/hybig/browse.py @@ -9,8 +9,8 @@ import numpy as np import rasterio from affine import dumpsw -from harmony.message import Message as HarmonyMessage -from harmony.message import Source as HarmonySource +from harmony_service_lib.message import Message as HarmonyMessage +from harmony_service_lib.message import Source as HarmonySource from matplotlib.cm import ScalarMappable from matplotlib.colors import Normalize from numpy import ndarray diff --git a/hybig/browse_utility.py b/hybig/browse_utility.py index 6dbd8cd..67578f6 100644 --- a/hybig/browse_utility.py +++ b/hybig/browse_utility.py @@ -1,6 +1,6 @@ """Module containing utility functionality for browse generation.""" -from harmony.message import Message as HarmonyMessage +from harmony_service_lib.message import Message as HarmonyMessage def get_harmony_message_from_params(params: dict | None) -> HarmonyMessage: diff --git a/hybig/color_utility.py b/hybig/color_utility.py index 9b81c29..4efdd68 100644 --- a/hybig/color_utility.py +++ b/hybig/color_utility.py @@ -7,7 +7,7 @@ import numpy as np import requests -from harmony.message import Source as HarmonySource +from harmony_service_lib.message import Source as HarmonySource from osgeo_utils.auxiliary.color_palette import ColorPalette from pystac import Item from rasterio.io import DatasetReader diff --git a/hybig/crs.py b/hybig/crs.py index 42ef015..87bedda 100644 --- a/hybig/crs.py +++ b/hybig/crs.py @@ -10,7 +10,7 @@ """ -from harmony.message import SRS +from harmony_service_lib.message import SRS from pyproj.crs import CRS as pyCRS # pylint: disable-next=no-name-in-module diff --git a/hybig/sizes.py b/hybig/sizes.py index 6464f9a..33bfe2f 100644 --- a/hybig/sizes.py +++ b/hybig/sizes.py @@ -13,8 +13,12 @@ import numpy as np from affine import Affine -from harmony.message import Message -from harmony.message_utility import has_dimensions, has_scale_extents, has_scale_sizes +from harmony_service_lib.message import Message +from harmony_service_lib.message_utility import ( + has_dimensions, + has_scale_extents, + has_scale_sizes, +) # pylint: disable-next=no-name-in-module from rasterio.crs import CRS diff --git a/pip_requirements.txt b/pip_requirements.txt index 7f1a0fd..736ebe9 100644 --- a/pip_requirements.txt +++ b/pip_requirements.txt @@ -1,8 +1,8 @@ -harmony-service-lib~=1.0.27 +harmony-service-lib~=2.0.0 matplotlib==3.9.0 numpy==1.26.4 pillow==10.4.0 pyproj==3.6.1 -pystac~=0.5.6 +pystac~=1.0.1 rasterio==1.3.10 rioxarray==0.17.0 diff --git a/tests/test_service/test_adapter.py b/tests/test_service/test_adapter.py index e078259..aa8ec9a 100644 --- a/tests/test_service/test_adapter.py +++ b/tests/test_service/test_adapter.py @@ -7,8 +7,8 @@ from unittest.mock import call, patch import numpy as np -from harmony.message import Message -from harmony.util import config +from harmony_service_lib.message import Message +from harmony_service_lib.util import config from pystac import Catalog from rasterio.transform import array_bounds, from_bounds from rasterio.warp import Resampling diff --git a/tests/test_service/unit/test_adapter_unit.py b/tests/test_service/unit/test_adapter_unit.py index 39e358b..3cf69eb 100644 --- a/tests/test_service/unit/test_adapter_unit.py +++ b/tests/test_service/unit/test_adapter_unit.py @@ -2,8 +2,8 @@ from unittest import TestCase from unittest.mock import Mock -from harmony.message import Message -from harmony.util import config +from harmony_service_lib.message import Message +from harmony_service_lib.util import config from pystac import Asset, Item from harmony_service.adapter import BrowseImageGeneratorAdapter diff --git a/tests/unit/test_browse.py b/tests/unit/test_browse.py index cbebb5a..020b13d 100644 --- a/tests/unit/test_browse.py +++ b/tests/unit/test_browse.py @@ -8,9 +8,9 @@ from unittest.mock import MagicMock, Mock, call, patch import numpy as np -from harmony.message import SRS -from harmony.message import Message as HarmonyMessage -from harmony.message import Source as HarmonySource +from harmony_service_lib.message import SRS +from harmony_service_lib.message import Message as HarmonyMessage +from harmony_service_lib.message import Source as HarmonySource from numpy.testing import assert_array_equal from osgeo_utils.auxiliary.color_palette import ColorPalette from PIL import Image diff --git a/tests/unit/test_color_utility.py b/tests/unit/test_color_utility.py index 2f65870..d8c571c 100644 --- a/tests/unit/test_color_utility.py +++ b/tests/unit/test_color_utility.py @@ -2,7 +2,7 @@ from unittest import TestCase from unittest.mock import Mock, patch -from harmony.message import Source as HarmonySource +from harmony_service_lib.message import Source as HarmonySource from osgeo_utils.auxiliary.color_palette import ColorPalette from pystac import Asset, Item from rasterio import DatasetReader diff --git a/tests/unit/test_crs.py b/tests/unit/test_crs.py index baf4dc8..f69607f 100644 --- a/tests/unit/test_crs.py +++ b/tests/unit/test_crs.py @@ -8,7 +8,7 @@ from unittest.mock import patch from affine import Affine -from harmony.message import SRS +from harmony_service_lib.message import SRS from rasterio.crs import CRS from rioxarray import open_rasterio diff --git a/tests/unit/test_sizes.py b/tests/unit/test_sizes.py index dcfca1b..a4d0a65 100644 --- a/tests/unit/test_sizes.py +++ b/tests/unit/test_sizes.py @@ -5,7 +5,7 @@ from unittest.mock import MagicMock, patch import rasterio -from harmony.message import Message +from harmony_service_lib.message import Message from rasterio import Affine from rasterio.crs import CRS from rioxarray import open_rasterio diff --git a/tests/utilities.py b/tests/utilities.py index 0c81a58..59481f4 100644 --- a/tests/utilities.py +++ b/tests/utilities.py @@ -3,7 +3,7 @@ from collections import namedtuple from datetime import datetime -from harmony.util import bbox_to_geometry +from harmony_service_lib.util import bbox_to_geometry from pystac import Asset, Catalog, Item Granule = namedtuple('Granule', ['url', 'media_type', 'roles'])