Skip to content

Commit

Permalink
add metrics to to __init__, tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tedw0ng committed Dec 7, 2024
1 parent adb6203 commit ab6c879
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions city_metrix/metrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 10 additions & 1 deletion tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit ab6c879

Please sign in to comment.