From ab6c879c17b3d437feaad9b86fe217738889eb94 Mon Sep 17 00:00:00 2001 From: Ted Wong Date: Fri, 6 Dec 2024 21:51:59 -0500 Subject: [PATCH] add metrics to to __init__, tests --- city_metrix/metrics/__init__.py | 2 ++ tests/test_metrics.py | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/city_metrix/metrics/__init__.py b/city_metrix/metrics/__init__.py index d95cfa5c..bfba5fcb 100644 --- a/city_metrix/metrics/__init__.py +++ b/city_metrix/metrics/__init__.py @@ -5,3 +5,5 @@ from .urban_open_space import urban_open_space from .natural_areas import natural_areas from .era_5_met_preprocessing import era_5_met_preprocessing +from .who_air_pollutant_exceedance_days import who_air_pollutant_exceedance_days +from .annual_dailyconcentration_statistic import annual_dailyconcentration_statistic diff --git a/tests/test_metrics.py b/tests/test_metrics.py index 8fd42cc3..5f42da4d 100644 --- a/tests/test_metrics.py +++ b/tests/test_metrics.py @@ -3,6 +3,12 @@ import pytest +def test_annual_dailyconcentration_statistic(): + indicator_mean = test_annual_dailyconcentration_statistic(ZONES, 'mean') + indicator_max = test_annual_dailyconcentration_statistic(ZONES, 'max') + assert indicator_mean + assert indicator_max + def test_built_land_with_high_lst(): indicator = built_land_with_high_land_surface_temperature(ZONES) expected_zone_size = ZONES.geometry.size @@ -43,9 +49,12 @@ def test_natural_areas(): actual_indicator_size = indicator.size assert expected_zone_size == actual_indicator_size - def test_urban_open_space(): indicator = urban_open_space(ZONES) expected_zone_size = ZONES.geometry.size actual_indicator_size = indicator.size assert expected_zone_size == actual_indicator_size + +def test_who_air_pollutant_exceedance_days() + indicator = who_air_pollutant_exceedance_days(ZONES, ['so2']) + assert indicator <= 365