From 559cc665a30bff84cda6f2c4bb97f3c857dba27c Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Mon, 25 Nov 2024 19:53:34 +0100 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=93=8A=20fix=20hfd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From 521373c895a5ee4d5a42de8e0ae29ae951909a64 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Mon, 25 Nov 2024 20:11:35 +0100 Subject: [PATCH 2/3] add cohort, fix metadata --- etl/steps/data/garden/hmd/2024-11-19/hfd.meta.yml | 9 +++++---- etl/steps/data/garden/hmd/2024-11-19/hfd.py | 10 ++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/etl/steps/data/garden/hmd/2024-11-19/hfd.meta.yml b/etl/steps/data/garden/hmd/2024-11-19/hfd.meta.yml index 80c64e139c1..8fbc2cc9efa 100644 --- a/etl/steps/data/garden/hmd/2024-11-19/hfd.meta.yml +++ b/etl/steps/data/garden/hmd/2024-11-19/hfd.meta.yml @@ -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: @@ -321,7 +322,7 @@ tables: period_ages: variables: - asfr: + asfr_period: title: |- <% set title = "Period fertility rates" %> {definitions.others.title_age} @@ -335,7 +336,7 @@ tables: cohort_ages: variables: - asfr: + asfr_cohort: title: |- <% set title = "Cohort fertility rates" %> {definitions.others.title_age} diff --git a/etl/steps/data/garden/hmd/2024-11-19/hfd.py b/etl/steps/data/garden/hmd/2024-11-19/hfd.py index 9cea04c68c9..2ad25b7d3dd 100644 --- a/etl/steps/data/garden/hmd/2024-11-19/hfd.py +++ b/etl/steps/data/garden/hmd/2024-11-19/hfd.py @@ -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"] @@ -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. From 14395615f8087a233a08f22198abcd87011fc453 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Mon, 25 Nov 2024 20:13:51 +0100 Subject: [PATCH 3/3] 'less' to 'less equal' --- etl/steps/data/garden/hmd/2024-11-19/hfd.meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etl/steps/data/garden/hmd/2024-11-19/hfd.meta.yml b/etl/steps/data/garden/hmd/2024-11-19/hfd.meta.yml index 8fbc2cc9efa..2935b6d6bdf 100644 --- a/etl/steps/data/garden/hmd/2024-11-19/hfd.meta.yml +++ b/etl/steps/data/garden/hmd/2024-11-19/hfd.meta.yml @@ -30,7 +30,7 @@ definitions: << title >> - Birth order: << birth_order >> <%- endif %> title_age: |- - <% set age_str = '<12' if age == '12-' else age %> + <% set age_str = '≤12' if age == '12-' else age %> <% if birth_order == 'total' %> << title >> - Mother age: << age_str >> - All births <%- else %>