diff --git a/blue_geo/__init__.py b/blue_geo/__init__.py index 61f78c3f..a8401e45 100644 --- a/blue_geo/__init__.py +++ b/blue_geo/__init__.py @@ -4,7 +4,7 @@ DESCRIPTION = f"{ICON} AI for precise geospatial data analysis and visualization." -VERSION = "4.143.1" +VERSION = "4.144.1" REPO_NAME = "blue-geo" diff --git a/blue_geo/catalog/firms/area/__main__.py b/blue_geo/catalog/firms/area/__main__.py index 3036b580..b4669498 100644 --- a/blue_geo/catalog/firms/area/__main__.py +++ b/blue_geo/catalog/firms/area/__main__.py @@ -2,9 +2,8 @@ from datetime import datetime, timedelta from blue_geo import VERSION from abcli.plugins.metadata import post_to_object -from blue_geo.catalog.firms.area import NAME -from blue_geo.catalog.firms.area.enums import Area, Source -from blue_geo.catalog.firms.area import FirmsAreaDatacube +from .enums import Area, Source +from . import FirmsAreaDatacube, NAME from blue_geo.logger import logger from blueness.argparse.generic import sys_exit diff --git a/blue_geo/tests/test_datacube_firms_area.py b/blue_geo/tests/test_catalog_firms_area.py similarity index 62% rename from blue_geo/tests/test_datacube_firms_area.py rename to blue_geo/tests/test_catalog_firms_area.py index 305b4932..e9caaf2c 100644 --- a/blue_geo/tests/test_datacube_firms_area.py +++ b/blue_geo/tests/test_catalog_firms_area.py @@ -2,6 +2,7 @@ import geopandas as gpd from abcli.modules.objects import unique_object from blue_geo.tests import assets +from blue_geo.catalog.firms import FirmsCatalog from blue_geo.catalog.firms.area import enums, FirmsAreaDatacube @@ -22,6 +23,10 @@ def test_datacube_from_query( datacube = FirmsAreaDatacube(area=area, source=source) + assert isinstance(datacube.catalog, FirmsCatalog) + + assert datacube.datacube_id + assert datacube.description assert datacube.ingest_url() @@ -32,44 +37,44 @@ def test_datacube_from_query( assert success assert isinstance(gdf, gpd.GeoDataFrame) - assert datacube.datacube_id - @pytest.mark.parametrize( ["datacube_id"], [ - ["datacube-firms_area-world-MODIS_NRT-2024-07-20-1"], + [ + [ + datacube_id + for datacube_id, datacube_class in assets.datacubes.items() + if datacube_class == FirmsAreaDatacube + ][-1] + ], ], ) -def test_datacube_from_datacube_id( - datacube_id: str, -): +def test_datacube_from_datacube_id(datacube_id: str): object_name = unique_object() - datacube = FirmsAreaDatacube(datacube_id=datacube_id) - - assert datacube.description + datacube = FirmsAreaDatacube(datacube_id) - assert datacube.ingest_url() + assert datacube.datacube_id - assert datacube.ingest_url(html=True) + assert datacube.description - success, gdf = datacube.ingest(object_name) + success, _ = datacube.ingest(object_name) assert success - assert isinstance(gdf, gpd.GeoDataFrame) - - assert datacube.datacube_id @pytest.mark.parametrize( ["datacube_id", "expected_success"], - assets.datacube_firms_area_parse_datacube_id, + [ + [ + [datacube_id, datacube_class == FirmsAreaDatacube] + for datacube_id, datacube_class in assets.datacubes.items() + ] + ], ) def test_parse_datacube_id( datacube_id: str, expected_success: bool, ): - success, segments = FirmsAreaDatacube.parse_datacube_id(datacube_id) + success, _ = FirmsAreaDatacube.parse_datacube_id(datacube_id) assert success == expected_success - if success: - assert segments