Skip to content

Commit

Permalink
almost expecting the tests to pass 🀞🏽 - kamangir/bolt#746
Browse files Browse the repository at this point in the history
  • Loading branch information
kamangir committed Jul 26, 2024
1 parent dd2c95b commit a9040d7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 23 deletions.
2 changes: 1 addition & 1 deletion blue_geo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
5 changes: 2 additions & 3 deletions blue_geo/catalog/firms/area/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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()
Expand All @@ -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

0 comments on commit a9040d7

Please sign in to comment.