You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
make it so you don't need to make distance_from_features and climate_change special cases. also maybe we need to handle 2010 and 2000 better. Currently the category list is only used for CSV export and juxtastat.
def get_statistic_categories():
"""
Map from internal statistic names to categories.
"""
category_by_tree = {}
for category_id, category in statistics_tree.items():
for _, group in category["contents"].items():
for year, stats in group["contents"].items():
for stat in stats:
category_id_to_use = {
"distance_from_features": "feature",
"climate_change": "climate",
}.get(category_id, category_id)
category_by_tree[stat] = (
category_id_to_use if year in {2020, None} else str(year)
)
return category_by_tree
The text was updated successfully, but these errors were encountered:
make it so you don't need to make
distance_from_features
andclimate_change
special cases. also maybe we need to handle 2010 and 2000 better. Currently the category list is only used for CSV export and juxtastat.The text was updated successfully, but these errors were encountered: