Skip to content

Commit 21860c8

Browse files
authored
Merge pull request #59 from unicef-drp/indicator_updates
Added CRC optional protocols
2 parents 988230e + 8ddee98 commit 21860c8

File tree

5 files changed

+62
-18
lines changed

5 files changed

+62
-18
lines changed

dash_service/pages/transmonee.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
"WEALTH_QUINTILE": "Wealth_name",
154154
}
155155

156-
years = list(range(2000, 2024))
156+
years = list(range(2000, 2025))
157157

158158
# a key:value dictionary of countries where the 'key' is the country name as displayed in the selection
159159
# tree whereas the 'value' is the country name as returned by the sdmx list: https://sdmx.data.unicef.org/ws/public/sdmxapi/rest/codelist/UNICEF/CL_COUNTRY/1.0
@@ -772,7 +772,6 @@ def update_domain_with_url(subdomain_code):
772772
if subdomain_code in domain_info['SUBDOMAINS']:
773773
domain_name = domain_info['domain_name'] # Assuming this key holds the domain name
774774
domain_value = f"{domain_name}|{domain_page_path}"
775-
print(f"domain value {domain_value}")
776775
return domain_value # Return the domain value in the specified format
777776

778777
return None # Return None if no match is found
@@ -981,7 +980,7 @@ def get_data(
981980
)
982981

983982
start_period = years[0] if years else 2000
984-
end_period = years[-1] if years else 2023
983+
end_period = years[-1] if years else 2024
985984

986985
# Get data using the API access
987986
data = api_access.get_data(
@@ -2130,9 +2129,6 @@ def indicator_card(
21302129
(numerator_pairs.OBS_VALUE == len(indicators)).to_numpy().sum()
21312130
)
21322131
sources = numerator_pairs.index.tolist()
2133-
numerator_pairs = numerator_pairs[
2134-
numerator_pairs.OBS_VALUE == len(indicators)
2135-
]
21362132

21372133
else:
21382134
indicator_sum = numerator_pairs["OBS_VALUE"].to_numpy().sum()
@@ -2207,6 +2203,13 @@ def indicator_card(
22072203
status_mapping = {1: "A status", 2: "B status", 3: "C status", 4: "D status"}
22082204
# Map the OBS_VALUE to the corresponding status
22092205
numerator_pairs["OBS_VALUE"] = numerator_pairs["OBS_VALUE"].map(status_mapping)
2206+
2207+
if base_indicator in ['CR_UN_CHLD_SALE','CR_UN_CHLD_ARMED','CR_UN_CHLD_COMM', 'CR_SG_STT_FPOS',
2208+
'CR_SG_STT_NSDSFND', 'CR_SG_STT_NSDSIMPL', 'CR_SG_STT_NSDSFDGVT', 'CR_SG_STT_NSDSFDDNR',
2209+
'CR_SG_STT_NSDSFDOTHR', 'CR_SG_REG_CENSUSN', 'PP_SG_REG_BRTH90N', 'PP_SG_REG_DETH75N']:
2210+
status_mapping = {1: "Yes", 0: "No"}
2211+
# Map the OBS_VALUE to the corresponding status
2212+
numerator_pairs["OBS_VALUE"] = numerator_pairs["OBS_VALUE"].map(status_mapping)
22102213

22112214
return make_card(
22122215
suffix,
@@ -2335,8 +2338,8 @@ def download_data(n_clicks, data):
23352338
color="OBS_VALUE",
23362339
mapbox_style="carto-positron",
23372340
geojson=geo_json_countries,
2338-
zoom=2.5,
2339-
center={"lat": 51.9194, "lon": 19.040236},
2341+
zoom=2.2,
2342+
center={"lat": 51.5194, "lon": 14.0},
23402343
opacity=0.6,
23412344
custom_data=[
23422345
"OBS_VALUE",

dash_service/static/crm_framework_indicators.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,18 @@
164164
{
165165
"Indicator Name": "Existence of independent national human rights institutions in compliance with the Paris Principles (by status level) - SDG 16.a.1",
166166
"Code": "PP_SG_NHR_STATUS"
167+
},
168+
{
169+
"Indicator Name": "Status of ratification of the CRC Optional Protocol on the Sale of Children, Child Prostitution and Child Pornography",
170+
"Code": "CR_UN_CHLD_SALE"
171+
},
172+
{
173+
"Indicator Name": "Status of ratification of the CRC Optional Protocol on the Involvement of Children in Armed Conflict",
174+
"Code": "CR_UN_CHLD_ARMED"
175+
},
176+
{
177+
"Indicator Name": "Status of ratification of the CRC Optional Protocol on a Communications Procedure",
178+
"Code": "CR_UN_CHLD_COMM"
167179
}
168180
]
169181
},

dash_service/static/indicator_config.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@
149149
"DTYPE": "str",
150150
"NOMINAL": true
151151
},
152+
"CR_UN_CHLD_ARMED": {
153+
"DTYPE": "str",
154+
"NOMINAL": true
155+
},
156+
"CR_UN_CHLD_COMM": {
157+
"DTYPE": "str",
158+
"NOMINAL": true
159+
},
152160
"CR_UN_RIGHTS_DISAB": {
153161
"DTYPE": "str",
154162
"NOMINAL": true
@@ -8538,9 +8546,8 @@
85388546
"PV_AROPE": {
85398547
"AGE": {
85408548
"AGE": [
8541-
"_T",
8542-
"Y0T15",
8543-
"Y16T24",
8549+
"Y0T18",
8550+
"Y18T24",
85448551
"Y25T54",
85458552
"Y_GE55"
85468553
],

dash_service/static/indicator_definitions.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,17 @@
6464
"EC_GEN_CONF_JUD": "Share of women declaring lack of confidence in the justice system",
6565
"EC_HCI_OVRL": "Human capital index (HCI) (scale 0-1)",
6666
"EC_MIN_WAGE": "Minimum wages (EUR)",
67-
"CR_UN_CHLD_SALE": "UN Convention on the Rights of the Child, Optional Protocol on the sale of children, child prostitution and child pornography (signature, ratification, accession or succession)",
68-
"CR_UN_RIGHTS_DISAB": "UN Convention on the Rights of Persons with Disabilities, 2006 (signature, formal confirmation, accession or ratification)",
69-
"CR_UN_CHLD_ARMED": "Optional Protocol to the Convention on the Rights of the Child on the involvement of children in armed conflict (signature, ratification, accession or succession) ",
70-
"CR_UN_CHLD_COMM": "Optional Protocol to the Convention on the Rights of the Child on a communications procedure(signature, ratification, accession or succession) ",
67+
"CR_UN_CHLD_SALE": "Status of ratification of the Optional Protocol to the Convention on the Rights of the Child on the Sale of Children, Child Prostitution and Child Pornography (Yes = ratification, signature, acceptance, accession or succession)",
68+
"CR_UN_RIGHTS_DISAB": "Status of ratification of the UN Convention on the Rights of Persons with Disabilities, 2006 (Yes = ratification, signature, acceptance, accession or succession)",
69+
"CR_UN_CHLD_ARMED": "Status of ratification of the Optional Protocol to the Convention on the Rights of the Child on the Involvement of Children in Armed Conflict (Yes = ratification, signature, acceptance, accession or succession)",
70+
"CR_UN_CHLD_COMM": "Status of ratification of the Optional Protocol to the Convention on the Rights of the Child on a Communications Procedure (Yes = ratification, signature, acceptance, accession or succession)",
7171
"PP_SG_NHR_STATUS": "Existence of independent national human rights institutions in compliance with the Paris Principles. Value 1 = A status: 'Countries with national human rights institutions in compliance with the Paris Principles'. Value 2 = B status: 'Countries with national human rights institutions not fully compliant with the Paris Principles'. Value 3 = C status: 'Countries with national human rights institutions and no status with the Paris Principles'. Value 4 = D status: 'Countries with no application for accreditation with the Paris Principles'. The Paris Principles ('Principles Relating to the Status of National Human Rights Institutions') set out the minimum standards that NHRIs must meet in order to be considered credible and to operate effectively.",
7272
"PP_SG_NHR_INTEXSTN": "Existence of independent national human rights institutions in compliance with the Paris Principles. The Paris Principles ('Principles Relating to the Status of National Human Rights Institutions') set out the minimum standards that NHRIs must meet in order to be considered credible and to operate effectively. A status: compliant with Paris Principles, B status: not fully compliant with Paris Principles, C status: no status, D status: no application for accreditation",
7373
"PP_SG_NHR_NOSTUSN": "Existence of independent national human rights institutions in compliance with the Paris Principles. The Paris Principles ('Principles Relating to the Status of National Human Rights Institutions') set out the minimum standards that NHRIs must meet in order to be considered credible and to operate effectively. A status: compliant with Paris Principles, B status: not fully compliant with Paris Principles, C status: no status, D status: no application for accreditation",
7474
"PP_SG_NHR_NOAPPLN": "Existence of independent national human rights institutions in compliance with the Paris Principles. The Paris Principles ('Principles Relating to the Status of National Human Rights Institutions') set out the minimum standards that NHRIs must meet in order to be considered credible and to operate effectively. A status: compliant with Paris Principles, B status: not fully compliant with Paris Principles, C status: no status, D status: no application for accreditation",
7575
"CR_VC_VOV_GDSD": "Percentage of population reporting having personally felt discriminated against or harassed in the previous 12 months on the basis of a ground of discrimination prohibited under international human rights law",
7676
"CR_VC_VOV_GDSD_DISHEA_PD": "Percentage of persons with disability reporting having felt discriminated against, by grounds of disability or health status - SDG 10.3.1",
77-
"CR_UN_CHLD_RIGHTS": "UN Convention on the Rights of the Child, 1989 (signature, ratification, acceptance, accession or succession)",
77+
"CR_UN_CHLD_RIGHTS": "Status of ratification of the UN Convention on the Rights of the Child, 1989 (Yes = ratification, signature, acceptance, accession or succession)",
7878
"EDU_FIN_EXP_PT_GDP": "Government expenditure on education (current and capital) expressed as a percentage of\nthe Gross Domestic Product (GDP) in a given financial year.",
7979
"EC_SP_GOV_EXP_GDP": "General government expenditure on social protection (% of GDP)",
8080
"EC_SP_GOV_EXP_TOT": "General government expenditure on social protection (% of total government expenditure)",

dash_service/static/page_config.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,31 @@
232232
'suffix': 'countries in compliance with the Paris Principles',
233233
'min_max': False,
234234
'yaxis': number_countries,
235-
'button_name': 'Status of national human rights institutions (SDG 16.a.1)'}],
235+
'button_name': 'Status of national human rights institutions (SDG 16.a.1)'},
236+
{'name': 'Status of ratification of the CRC Optional Protocol on the Sale of Children, Child Prostitution and Child Pornography',
237+
'indicator': 'CR_UN_CHLD_SALE',
238+
'suffix': 'countries have ratified the optional protocol',
239+
'min_max': False,
240+
'yaxis': number_countries,
241+
'button_name': 'CRC Optional Protocol on the Sale of Children, Child Prostitution and Child Pornography'},
242+
{'name': 'Status of ratification of the CRC Optional Protocol on the Involvement of Children in Armed Conflict',
243+
'indicator': 'CR_UN_CHLD_ARMED',
244+
'suffix': 'countries have ratified the optional protocol',
245+
'min_max': False,
246+
'yaxis': number_countries,
247+
'button_name': 'CRC Optional Protocol on the Involvement of Children in Armed Conflict'},
248+
{'name': 'Status of ratification of the CRC Optional Protocol on a Communications Procedure',
249+
'indicator': 'CR_UN_CHLD_COMM',
250+
'suffix': 'countries have ratified the optional protocol',
251+
'min_max': False,
252+
'yaxis': number_countries,
253+
'button_name': 'CRC Optional Protocol on a Communications Procedure'}],
236254
'AIO_AREA': {
237-
'indicators': ['PP_SG_NHR_STATUS'],
255+
'indicators': ['PP_SG_NHR_STATUS',
256+
'CR_UN_CHLD_SALE',
257+
'CR_UN_CHLD_ARMED',
258+
'CR_UN_CHLD_COMM'
259+
],
238260
'default_graph': 'map',
239261
'default': 'PP_SG_NHR_STATUS'}},
240262
'SPE': {'NAME': 'Public spending on children',

0 commit comments

Comments
 (0)