-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
🔨 Jinja metadata for UN IGME #1898
Conversation
Ah, I think it's because the section at the top e.g. where I have |
You were pretty close @spoonerf! Here is the corrected version (took me a while, working with templates can get complex) definitions:
common:
presentation:
topic_tags:
- Child & Infant Mortality
sex: |-
<% if sex == "Both sexes" %>
<% elif sex == "Male" %>
male
<% elif sex == "Female" %>
female
<%- endif -%>
wealth_quintile: |-
<% if wealth_quintile == "All wealth quintiles" %>
all wealth quintiles
<% elif wealth_quintile == "Poorest quintile" %>
the poorest 20% of the population
<% elif wealth_quintile == "Second poorest quintile" %>
the second poorest 20% of the population
<% elif wealth_quintile == "Middle wealth quintile" %>
the middle 20% of the population in terms of wealth
<% elif wealth_quintile == "Fourth poorest quintile" %>
the second richest 20% of the population
<% elif wealth_quintile == "Richest quintile" %>
the richest 20% of the population
<%- endif -%>
unit_of_measure:
unit: |-
<% if unit_of_measure == "Deaths per 1,000 live births" %>
deaths per 1,000 live births
<% elif unit_of_measure == "Deaths per 1000 children aged 10" %>
deaths per 1,000 children aged 10
<% elif unit_of_measure == "Deaths per 1000 children aged 15" %>
deaths per 1,000 children aged 15
<% elif unit_of_measure == "Deaths per 1000 children aged 1" %>
deaths per 1,000 children aged 1
<% elif unit_of_measure == "Deaths per 1000 children aged 20" %>
deaths per 1,000 children aged 20
<% elif unit_of_measure == "Deaths per 1000 children aged 5" %>
deaths per 1,000 children aged 5
<% elif unit_of_measure == "Number of stillbirths" %>
stillbirths
<% elif unit_of_measure == "Stillbirths per 1,000 total births" %>
stillbirths per 1,000 total births
<% elif unit_of_measure == "Number of deaths" %>
deaths
<%- endif -%>
indicator:
display_name: |-
<% if indicator == "Neonatal mortality rate" %>
The estimated number of deaths of << sex >> children aged less than 28 days, per 1,000 live births, in <<wealth_quintile>>.
<% elif indicator == "Mortality rate 1-59 months" %>
The estimated number of deaths of << sex >> children aged between 1 and 59 months, per 1,000 live births, in <<wealth_quintile>>.
<% elif indicator == "Infant mortality rate" %>
The estimated number of deaths of << sex >> children aged under one year, per 1,000 live births, in <<wealth_quintile>>.
<% elif indicator == "Under-five mortality rate" %>
The estimated number of deaths of << sex >> children aged under five years, per 1,000 live births, in <<wealth_quintile>>.
<% elif indicator == "Mortality rate age 10-14" %>
The estimated number of deaths of << sex >> children aged between 10 and 14, per 1,000 children aged 10, in <<wealth_quintile>>.
<% elif indicator == "Mortality rate age 10-19" %>
The estimated number of deaths of << sex >> children aged between 10 and 19, per 1,000 children aged 10, in <<wealth_quintile>>.
<% elif indicator == "Mortality rate age 15-19" %>
The estimated number of deaths of << sex >> children aged between 15 and 19, per 1,000 children aged 15, in <<wealth_quintile>>.
<% elif indicator == "Mortality rate age 15-24" %>
The estimated number of deaths of << sex >> children aged between 15 and 24, per 1,000 children aged 15, in <<wealth_quintile>>.
<% elif indicator == "Child Mortality rate age 1-4" %>
The estimated number of deaths of << sex >> children aged between 1 and 4, per 1,000 children aged 1, in <<wealth_quintile>>.
<% elif indicator == "Mortality rate age 20-24" %>
The estimated number of deaths of << sex >> children aged between 20 and 24, per 1,000 children aged 20, in <<wealth_quintile>>.
<% elif indicator == "Mortality rate age 5-14" %>
The estimated number of deaths of << sex >> children aged between 5 and 14, per 1,000 children aged 5, in <<wealth_quintile>>.
<% elif indicator == "Mortality rate age 5-24" %>
The estimated number of deaths of << sex >> children aged between 5 and 24, per 1,000 children aged 5, in <<wealth_quintile>>.
<% elif indicator == "Mortality rate age 5-9" %>
The estimated number of deaths of << sex >> children aged between 5 and 9, per 1,000 children aged 5, in <<wealth_quintile>>.
<% elif indicator == "Stillbirths" %>
The estimated number of stillbirths, in <<wealth_quintile>>.
<% elif indicator == "Stillbirth rate" %>
The estimated number of stillbirths, per 1,000 total births, in <<wealth_quintile>>.
<% elif indicator == "Neonatal deaths" %>
The estimated number of deaths of << sex >> children aged less than 28 days, in <<wealth_quintile>>.
<% elif indicator == "Deaths 1-59 months" %>
The estimated number of deaths of << sex >> children aged between 1 and 59 months, in <<wealth_quintile>>.
<% elif indicator == "Mortality rate age 5-14" %>
The estimated number of deaths of << sex >> children aged between 5 and 14, per 1,000 children aged 5, in <<wealth_quintile>>.
<% elif indicator == "Mortality rate age 5-14" %>
The estimated number of deaths of << sex >> children aged between 5 and 14, per 1,000 children aged 5, in <<wealth_quintile>>.
<% elif indicator == "Mortality rate age 5-14" %>
The estimated number of deaths of << sex >> children aged between 5 and 14, per 1,000 children aged 5, in <<wealth_quintile>>.
<% elif indicator == "Mortality rate age 5-14" %>
The estimated number of deaths of << sex >> children aged between 5 and 14, per 1,000 children aged 5, in <<wealth_quintile>>.
<% elif indicator == "Mortality rate age 5-14" %>
The estimated number of deaths of << sex >> children aged between 5 and 14, per 1,000 children aged 5, in <<wealth_quintile>>.
<% elif indicator == "Mortality rate age 5-14" %>
The estimated number of deaths of << sex >> children aged between 5 and 14, per 1,000 children aged 5, in <<wealth_quintile>>.
<% elif indicator == "Mortality rate age 5-14" %>
The estimated number of deaths of << sex >> children aged between 5 and 14, per 1,000 children aged 5, in <<wealth_quintile>>.
<% elif indicator == "Mortality rate age 5-14" %>
The estimated number of deaths of << sex >> children aged between 5 and 14, per 1,000 children aged 5, in <<wealth_quintile>>.
<% elif indicator == "Mortality rate age 5-14" %>
The estimated number of deaths of << sex >> children aged between 5 and 14, per 1,000 children aged 5, in <<wealth_quintile>>.
<% elif indicator == "Mortality rate age 5-14" %>
The estimated number of deaths of << sex >> children aged between 5 and 14, per 1,000 children aged 5, in <<wealth_quintile>>.
<%- endif -%>
tables:
igme:
variables:
observation_value:
title: Observation value
unit: |-
{definitions.unit_of_measure.unit}
display:
name: |-
{definitions.indicator.display_name}
lower_bound:
title: Lower bound
unit: |-
{definitions.unit_of_measure.unit}
display:
name: |-
{definitions.indicator.display_name}
upper_bound:
title: Upper bound
unit: |-
{definitions.unit_of_measure.unit}
display:
name: |-
{definitions.indicator.display_name} A couple of comments:
The template itself is good after fixing those small issues. I've tried running (When inserting to grapher, I got the error |
Amazing thanks @Marigold! I'll try and figure out the next steps and almost certainly ping you. I think it's likely the short names will be different, but I think we've got round that before by using chart revisions? |
Exactly. By the way it'd be great if you could ping me after this PR is ready before doing chart revisions. I'd like to test syncing of changes from staging servers to production. |
Hey @Marigold - I think we're at this stage now, I believe the only issue remaining is the |
I looked into the You should first rebase or merge this PR onto the master. I'd also recommend reordering index levels to be consistent with the current version to make chart revision easier
If you make this change and commit back, staging server will rebuild ETL and you should see an updated dataset there. Once you have that, the best way to fix this error is to map those variables with
and then approving them in chart revisions. I tried to do it myself, but it's not as straightforward as some old variables don't exist in the current dataset (something with middle income group and possibly others). With the new workflow, you can approve chart revisions on the staging server, then I can sync them to production (after we merge this PR). |
Amazing, thanks @Marigold! I had messed up some of the variables, making variable matching impossible, but sorted that out now. I have approved the chart revisions on the staging server. So I think we can merge this now? I will wait to hear from you before merging. |
* changing units to % * fixing short_unit * fixing conversion
Hey @Marigold this is a bit of a WIP but I'm trying to figure out Jinja templates. I think I am along the right lines but it doesn't seem to be adding the metadata to the variables as I expect. Probably missing something silly but if you could take a look when you get a chance that would be ace!