Skip to content

Commit

Permalink
📊 fix hfd (#3617)
Browse files Browse the repository at this point in the history
* 📊 fix hfd

* add cohort, fix metadata

* 'less' to 'less equal'
  • Loading branch information
lucasrodes authored Nov 25, 2024
1 parent f335b1a commit 900feb1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
9 changes: 5 additions & 4 deletions etl/steps/data/garden/hmd/2024-11-19/hfd.meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ definitions:
<< title >> - Birth order: << birth_order >>
<%- endif %>
title_age: |-
<% set age_str = '≤12' if age == '12-' else age %>
<% if birth_order == 'total' %>
<< title >> - Mother age: << age >> - Birth order: Total
<< title >> - Mother age: << age_str >> - All births
<%- else %>
<< title >> - Mother age: << age >> - Birth order: << birth_order >>
<< title >> - Mother age: << age_str >> - Birth order: << birth_order >>
<%- endif %>
common:
presentation:
Expand Down Expand Up @@ -321,7 +322,7 @@ tables:

period_ages:
variables:
asfr:
asfr_period:
title: |-
<% set title = "Period fertility rates" %>
{definitions.others.title_age}
Expand All @@ -335,7 +336,7 @@ tables:

cohort_ages:
variables:
asfr:
asfr_cohort:
title: |-
<% set title = "Cohort fertility rates" %>
{definitions.others.title_age}
Expand Down
10 changes: 10 additions & 0 deletions etl/steps/data/garden/hmd/2024-11-19/hfd.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,11 @@ def run(dest_dir: str) -> None:
short_name="period_ages",
fcn=keep_relevant_ages,
)
tb_period_ages = tb_period_ages.rename(
columns={
"asfr": "asfr_period",
}
)

# 4/ Cohort tables (by age)
cols_index = ["country", "cohort", "age"]
Expand All @@ -525,6 +530,11 @@ def run(dest_dir: str) -> None:
short_name="cohort_ages",
fcn=keep_relevant_ages,
)
tb_cohort_ages = tb_cohort_ages.rename(
columns={
"asfr": "asfr_cohort",
}
)

#
# Process data.
Expand Down

0 comments on commit 900feb1

Please sign in to comment.