Skip to content

Commit

Permalink
Fix pop and pop density choropleths
Browse files Browse the repository at this point in the history
  • Loading branch information
nesnoj committed Oct 19, 2023
1 parent 1ae3f1c commit 1d5b9d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions digiplan/map/choropleths.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ def get_values_per_feature(self) -> dict[int, float]: # noqa: D102

class PopulationChoropleth(Choropleth): # noqa: D101
def get_values_per_feature(self) -> dict[int, float]: # noqa: D102
return models.Population.quantity_per_municipality_per_year().sum(axis=1).to_dict()
return models.Population.quantity_per_municipality_per_year()[2022].to_dict()


class PopulationDensityChoropleth(Choropleth): # noqa: D101
def get_values_per_feature(self) -> dict[int, float]: # noqa: D102
population = models.Population.quantity_per_municipality_per_year()
population = models.Population.quantity_per_municipality_per_year()[2022]
population_square = calculations.calculate_square_for_value(population)
return population_square.sum(axis=1).to_dict()
return population_square.to_dict()


class EmployeesChoropleth(Choropleth): # noqa: D101
Expand Down

0 comments on commit 1d5b9d2

Please sign in to comment.