diff --git a/flood_adapt/object_model/direct_impacts.py b/flood_adapt/object_model/direct_impacts.py index 09a7c6d64..b4a4e2fa8 100644 --- a/flood_adapt/object_model/direct_impacts.py +++ b/flood_adapt/object_model/direct_impacts.py @@ -387,9 +387,9 @@ def _create_equity(self, metrics_path): ), damages_table=fiat_data, aggregation_label=self.site_info.attrs.fiat.aggregation[ind].field_name, - percapitalincome_label=self.site_info.attrs.fiat.aggregation[ + percapitaincome_label=self.site_info.attrs.fiat.aggregation[ ind - ].equity.percapitalincome_label, + ].equity.percapitaincome_label, totalpopulation_label=self.site_info.attrs.fiat.aggregation[ ind ].equity.totalpopulation_label, diff --git a/flood_adapt/object_model/interface/site.py b/flood_adapt/object_model/interface/site.py index 6b5a728b4..55e75ffb5 100644 --- a/flood_adapt/object_model/interface/site.py +++ b/flood_adapt/object_model/interface/site.py @@ -144,7 +144,7 @@ class DemModel(BaseModel): class EquityModel(BaseModel): census_data: str - percapitalincome_label: Optional[str] = "PerCapitalIncome" + percapitaincome_label: Optional[str] = "PerCapitaIncome" totalpopulation_label: Optional[str] = "TotalPopulation" diff --git a/tests/test_object_model/test_site.py b/tests/test_object_model/test_site.py index 370b423dd..5e413b239 100644 --- a/tests/test_object_model/test_site.py +++ b/tests/test_object_model/test_site.py @@ -131,7 +131,7 @@ def test_dict(): "field_name": "name", "equity": { "census_data": "../templates/fiat/equity/census_data_aggr_lvl_1.csv", - "percapitalincome_label": "PerCapitaIncome", + "percapitaincome_label": "PerCapitaIncome", "totalpopulation_label": "TotalPopulation", }, }, @@ -141,7 +141,7 @@ def test_dict(): "field_name": "name", "equity": { "census_data": "../templates/fiat/equity/census_data_aggr_lvl_2.csv", - "percapitalincome_label": "PerCapitaIncome", + "percapitaincome_label": "PerCapitaIncome", "totalpopulation_label": "TotalPopulation", }, },