Skip to content

Commit

Permalink
add tests for era 5 layer and metric
Browse files Browse the repository at this point in the history
  • Loading branch information
weiqi-tori committed Aug 8, 2024
1 parent 31174a9 commit 5ce1b04
Show file tree
Hide file tree
Showing 4 changed files with 342 additions and 1 deletion.
3 changes: 2 additions & 1 deletion city_metrix/metrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
from .built_land_with_high_land_surface_temperature import built_land_with_high_land_surface_temperature
from .mean_tree_cover import mean_tree_cover
from .urban_open_space import urban_open_space
from .natural_areas import natural_areas
from .natural_areas import natural_areas
from .era_5_met_preprocessing import era_5_met_preprocessing
332 changes: 332 additions & 0 deletions notebooks/layers/era_5_hottest_day.ipynb

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions tests/test_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
TreeCanopyHeight,
TreeCover,
UrbanLandUse,
Era5HottestDay,
)
from city_metrix.layers.layer import get_image_collection

Expand Down Expand Up @@ -170,3 +171,7 @@ def test_overture_buildings():
def test_nasa_dem():
mean = NasaDEM().get_data(BBOX_BRAZIL_LAURO_DE_FREITAS_1).mean()
assert mean

def test_era_5_hottest_day():
mean = Era5HottestDay().get_data(BBOX_BRAZIL_LAURO_DE_FREITAS_1).mean()
assert mean
3 changes: 3 additions & 0 deletions tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ def test_high_lst():
indicator = built_land_with_high_land_surface_temperature(ZONES)
assert indicator.size == 100

def test_era_5_met_preprocess():
indicator = era_5_met_preprocessing(ZONES)
assert len(indicator) == 24

0 comments on commit 5ce1b04

Please sign in to comment.