Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📊 fix hfd #3617

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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