Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
camereb committed Feb 20, 2023
2 parents d0b795f + 79bcb55 commit d93ef2b
Show file tree
Hide file tree
Showing 30 changed files with 515 additions and 466 deletions.
42 changes: 20 additions & 22 deletions CIFProgressStatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,28 +73,26 @@ def update_progress_status(progress_dict, indicator_id):
write_meta_md(meta, indicator_id)


# indicator_ids = get_indicator_ids()

# TODO: if auto prog is OFF, shouldn't calculate!!!!!!!!!
# for ind_id in indicator_ids:
# # Uncomment to turn on ALL indicator calculation
# # turn_on_progress_calc(ind_id)
#
# # Get data + metadata for calculation
# indicator = merge_indicator(ind_id)
# if indicator is not None:
# # Run data + metadata through calculation to get progress
# progress = pm.measure_indicator_progress(indicator)
#
# if progress is None:
# progress = 'not_available'
#
# print(ind_id + ': ' + progress)
#
# # Update progress status field in meta
# progress_dict = {'progress_status': progress}
# # update_progress_status(progress_dict, ind_id)
# print(progress_dict)
indicator_ids = get_indicator_ids()
all_progress_statuses = {}

for ind_id in indicator_ids:
# Uncomment to turn on ALL indicator calculation
# turn_on_progress_calc(ind_id)

# Get data + metadata for calculation
indicator = merge_indicator(ind_id)
if indicator is not None:
# Run data + metadata through calculation to get progress
progress = pm.measure_indicator_progress(indicator)
all_progress_statuses[ind_id] = progress

if progress is not None:
print(ind_id + ': ' + progress)
# Update progress status field in meta
progress_dict = {'progress_status': progress}
# Uncomment to update metadata files
update_progress_status(progress_dict, ind_id)

# individal calculations result ----
# test_ind = merge_indicator('12-2-1')
Expand Down
2 changes: 1 addition & 1 deletion ProgressMeasure.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def methodology_1(data, config):
elif z <= cagr_o <= y:
return "moderate_deterioration"
elif cagr_o < z:
return "significant_deterioration"
return "substantial_deterioration"
else:
return None

Expand Down
826 changes: 438 additions & 388 deletions data/indicator_3-2-1.csv

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion meta/10-2-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ source_geographical_coverage_1: Canada and provinces
auto_progress_calculation: true
progress_calculation_options:
- direction: negative
progress_status: significant_deterioration
progress_status: substantial_deterioration
---
2 changes: 1 addition & 1 deletion meta/12-2-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ source_geographical_coverage_2: Canada
auto_progress_calculation: true
progress_calculation_options:
- direction: positive
progress_status: significant_deterioration
progress_status: substantial_deterioration
---
2 changes: 1 addition & 1 deletion meta/15-2-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ source_geographical_coverage_1: Canada
auto_progress_calculation: true
progress_calculation_options:
- direction: positive
progress_status: significant_deterioration
progress_status: substantial_deterioration
---
This indicator corresponds to the Canadian Environmental Sustainability Indicators <a href="https://www.canada.ca/en/environment-climate-change/services/environmental-indicators/species-risk-population-trends.html"> <em>Species at risk population trends</em></a>.
2 changes: 1 addition & 1 deletion meta/15-4-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ source_geographical_coverage_2: Canada
auto_progress_calculation: true
progress_calculation_options:
- direction: positive
progress_status: moderate_progress
progress_status: substantial_deterioration
---
2 changes: 1 addition & 1 deletion meta/16-3-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ data_start_values:
value: Total violent Criminal Code violations

data_non_statistical: false
data_show_map: true
data_show_map: false


# Source
Expand Down
2 changes: 1 addition & 1 deletion meta/16-4-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ source_geographical_coverage_1: Canada
auto_progress_calculation: true
progress_calculation_options:
- direction: negative
progress_status: significant_deterioration
progress_status: substantial_deterioration
---
14 changes: 3 additions & 11 deletions meta/3-2-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,17 @@ indicator_number: 3.2.1
sdg_goal: '3'
data_non_statistical: false
target_id: '3.2'
data_show_map: false
data_show_map: true

# Source(s)
source_active_1: true
source_url_text_1: Canadian Student Tobacco, Alcohol and Drugs Survey 2018-19
source_url_1: https://www.canada.ca/en/health-canada/services/canadian-student-tobacco-alcohol-drugs-survey/2018-2019-detailed-tables.html#t6
source_url_text_1: Canadian Student Tobacco, Alcohol and Drugs Survey
source_url_1: https://www.canada.ca/en/health-canada/services/canadian-student-tobacco-alcohol-drugs-survey.html
source_organisation_1: Propel Centre for Population Health Impact at the University
of Waterloo
source_periodicity_1: Every 2 years
source_geographical_coverage_1: Canada (excluding territories) and provinces

source_active_2: true
source_url_text_2: Canadian Student Tobacco, Alcohol and Drugs Survey 2016-17
source_url_2: https://www.canada.ca/en/health-canada/services/canadian-student-tobacco-alcohol-drugs-survey/2016-2017-supplementary-tables.html#t6
source_organisation_2: Propel Centre for Population Health Impact at the University
of Waterloo
source_periodicity_2: Every 2 years
source_geographical_coverage_2: Canada (excluding territories) and provinces

# Progress status options
auto_progress_calculation: false
progress_calculation_options:
Expand Down
2 changes: 1 addition & 1 deletion meta/3-7-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ source_geographical_coverage_1: Canada (excluding territories) and provinces
auto_progress_calculation: true
progress_calculation_options:
- direction: positive
progress_status: significant_deterioration
progress_status: substantial_deterioration
---
2 changes: 1 addition & 1 deletion meta/6-2-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ source_geographical_coverage_3: Canada, provinces and territories
auto_progress_calculation: true
progress_calculation_options:
- direction: negative
progress_status: significant_deterioration
progress_status: substantial_deterioration
---
2 changes: 1 addition & 1 deletion meta/8-1-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,5 @@ source_geographical_coverage_4: Canada, Geographical region of Canada, Province
auto_progress_calculation: true
progress_calculation_options:
- direction: negative
progress_status: significant_deterioration
progress_status: substantial_deterioration
---
7 changes: 2 additions & 5 deletions meta/8-2-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,10 @@ data_show_map: false

source_active_1: true
source_url_text_1: Statistics Canada. Labour Force Survey - Custom tabulation
# source_url_1:
source_url_1: https://www23.statcan.gc.ca/imdb/p2SV.pl?Function=getSurvey&SDDS=3701
source_organisation_1: Statistics Canada
source_periodicity_1: Annual
source_geographical_coverage_1: Canada
auto_progress_calculation: true
progress_calculation_options:
- direction: negative
progress_status: not_available
---
<i>This indicator does not display a progress status as there is only one data point currently available.</i>
<i>This indicator does not display a progress status as there is only one data point currently available.</i>
2 changes: 1 addition & 1 deletion meta/8-3-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ source_geographical_coverage_1: Canada, provinces and territories
auto_progress_calculation: true
progress_calculation_options:
- direction: negative
progress_status: significant_deterioration
progress_status: substantial_deterioration
---
2 changes: 1 addition & 1 deletion meta/9-1-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ source_geographical_coverage_1: Canada
auto_progress_calculation: true
progress_calculation_options:
- direction: positive
progress_status: significant_deterioration
progress_status: substantial_deterioration
---
3 changes: 2 additions & 1 deletion meta/9-3-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ data_show_map: true
# Source

source_active_1: true
source_url_text_1: Canadian Radio-television and Telecommunications Commission. Current trends - High-speed broadband, 2021.
source_url_text_1: Canadian Radio-television and Telecommunications Commission. Current
trends - High-speed broadband, 2021.
source_url_1: https://crtc.gc.ca/eng/publications/reports/PolicyMonitoring/ban.htm
source_organisation_1: Canadian Radio-television and Telecommunications Commission
source_periodicity_1: Annual
Expand Down
1 change: 1 addition & 0 deletions meta/fr/15-5-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ source_url_3: 'http://www.fao.org/3/ca9983en/ca9983en.pdf'
source_organisation_3: "Organisation des Nations Unies pour l'alimentation et l'agriculture"
source_geographical_coverage_3: 'Canada'
---
<i>Cet indicateur n'affiche pas de mesure de progrès pour le moment.</i>
12 changes: 2 additions & 10 deletions meta/fr/3-2-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,12 @@ indicator_number: 3.2.1
sdg_goal: '3'
data_non_statistical: false
target_id: '3.2'
data_show_map: false

# Source(s)
source_active_1: true
source_url_text_1: "Enquête canadienne sur le tabac, l'alcool et les drogues chez les élèves de 2018-2019"
source_url_1: 'https://www.canada.ca/fr/sante-canada/services/enquete-canadienne-tabac-alcool-et-drogues-eleves/2018-2019-tableaux-detailles.html'
source_url_text_1: "Enquête canadienne sur le tabac, l'alcool et les drogues chez les élèves"
source_url_1: https://www.canada.ca/fr/sante-canada/services/enquete-canadienne-tabac-alcool-et-drogues-eleves.html
source_organisation_1: "Centre pour l'avancement de la santé des populations Propel de l'Université de Waterloo"
source_periodicity_1: Tous les 2 ans
source_geographical_coverage_1: 'Canada (sauf territoires) et provinces'

source_active_2: true
source_url_text_2: "Enquête canadienne sur le tabac, l'alcool et les drogues chez les élèves de 2016-2017"
source_url_2: 'https://www.canada.ca/fr/sante-canada/services/enquete-canadienne-tabac-alcool-et-drogues-eleves/2016-2017-tableaux-supplementaires.html#t6'
source_organisation_2: "Centre pour l'avancement de la santé des populations Propel de l'Université de Waterloo"
source_periodicity_2: Tous les 2 ans
source_geographical_coverage_2: 'Canada (sauf territoires) et provinces'
---
2 changes: 1 addition & 1 deletion meta/fr/5-1-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ source_organisation_1: "Statistics Canada"
source_periodicity_1: Occasionnelle
source_geographical_coverage_1: 'Canada'
---
<i>This indicator does not display a progress status as there is only one data point, therefore progress cannot be calculated.</i>
<i>Cet indicateur n'affiche pas de mesure de progrès car il n'y a qu'une seule année actuellement disponible.</i>
1 change: 1 addition & 0 deletions meta/fr/5-2-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@ source_periodicity_4: Annuelle
source_geographical_coverage_4: 'Canada'
data_keywords: femme, genre
---
<i>Cet indicateur est composé de plusieurs sous-indicateurs, donc il n'y a pas de mesure de progrès aggrégée de rapportée. Le progrès pour les sous-indicateurs est disponibles sur demande.</i>
2 changes: 1 addition & 1 deletion scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
git+https://github.com/dougmet/yamlmd
git+https://github.com/open-sdg/sdg-build@2.0.0

frictionless==4.40.8
1 change: 1 addition & 0 deletions translations/en/data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ Agricultural Particulate Matter Emissions: Agricultural Particulate Matter Emiss
## 3-2-1
Grade: Grade
All grades: All grades
Grades 6-9: Grades 6-9
Grades 7-9: Grades 7-9
Grades 10-12: Grades 10-12
Type of e-cigarettes: Type of e-cigarettes
Expand Down
15 changes: 10 additions & 5 deletions translations/en/frontpage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ instructions: Select each goal to access the data
heading: Welcome to the Canadian Indicator Framework for the Sustainable Development Goals Data Hub
download_all: Download all data
second_header: Sustainable Development Goals Data Hub
second_content: "Canada's Global SDG Indicators Reporting"
second_text: Access Data Hub
second_link: https://www144.statcan.gc.ca/sdg-odd/index-eng.htm
second_content: |
Canada's Global SDG Indicators Reporting
[Access Data Hub](https://www144.statcan.gc.ca/sdg-odd/index-eng.htm)
#second_text: Access Data Hub
#second_link: https://www144.statcan.gc.ca/sdg-odd/index-eng.htm
third_header: About Canada and the Sustainable Development Goals
third_text: About Canada and the Sustainable Development Goals
third_link: https://www144.statcan.gc.ca/sdg-odd/about-apercu-eng.htm
third_content: |
[Read more](https://www144.statcan.gc.ca/sdg-odd/about-apercu-eng.htm)
#third_text: About Canada and the Sustainable Development Goals
#third_link: https://www144.statcan.gc.ca/sdg-odd/about-apercu-eng.htm
zip_file: ZIP file
intro_title: 17 goals to transform our world
intro_body: The <a href="https://www.un.org/sustainabledevelopment/sustainable-development-goals/">Sustainable Development Goals (SDGs)</a> are a universal call to action to end poverty, protect the planet and improve the lives and prospects of everyone, everywhere. The Canadian Indicator Framework encompasses the 17 goals, and adds Canadian Ambitions and Targets which have been elaborated by federal departments.
1 change: 1 addition & 0 deletions translations/en/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ contact_us: Contact us
cookies: Cookies
related-products: Related Products
methodology: Progress measurement methodology
more_info: More information
5 changes: 3 additions & 2 deletions translations/en/status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ moderate_progress: Moderate progress
negligible_progress: Negligible progress
deterioration: Deterioration
moderate_deterioration: Moderate deterioration
significant_deterioration: Significant deterioration
significant_deterioration: Substantial deterioration
substantial_deterioration: Substantial deterioration
progress_not_available: Not available
progress-header: <strong>Progress status</strong>
progress_header: <strong>Progress status</strong>
1 change: 1 addition & 0 deletions translations/fr/data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ Total, 12 years and over: Total, 12 ans et plus
## 3-2-1
Grade: Niveaux de scolarité
All grades: Tous les niveaux
Grades 6-9: 6e à 9e année
Grades 7-9: 7e à 9e année
Grades 10-12: 10e à 12e année
Type of e-cigarettes: Type de cigarettes
Expand Down
15 changes: 10 additions & 5 deletions translations/fr/frontpage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ instructions: Sélectionner chaque objectif pour accéder aux données
heading: Bienvenue au carrefour de données pour le Cadre d'indicateurs canadien lié aux objectifs de développement durable
download_all: Télécharger toutes les données
second_header: Carrefour de données liées aux objectifs de développement durable
second_content: "Données canadiennes relatives aux indicateurs des ODD"
second_text: Accéder le carrefour
second_link: <a href="https://www144.statcan.gc.ca/sdg-odd/index-fra.htm">Accéder le carrefour</a>
second_content: |
Canada's Global SDG Indicators Reporting
[Accéder le carrefour](https://www144.statcan.gc.ca/sdg-odd/index-fra.htm)
#second_text: Accéder le carrefour
#second_link: <a href="https://www144.statcan.gc.ca/sdg-odd/index-fra.htm">Accéder le carrefour</a>
third_header: "À propos du Canada et les objectifs de développement durable"
third_text: Accéder le carrefour
third_link: <a href="https://www144.statcan.gc.ca/sdg-odd/about-apercu-fra.htm">Accéder le carrefour</a>
third_content: |
[Lire la suite](https://www144.statcan.gc.ca/sdg-odd/about-apercu-fra.htm)
#third_text: Accéder le carrefour
#third_link: <a href="https://www144.statcan.gc.ca/sdg-odd/about-apercu-fra.htm">Accéder le carrefour</a>
zip_file: ficher ZIP
intro_title: 17 objectifs pour transformer notre monde
intro_body: Les <a href="https://www.un.org/sustainabledevelopment/fr">objectifs de développement durable (SDG)</a> sont un appel universel à l'action pour mettre fin à la pauvreté, protéger la planète et améliorer la vie et les perspectives de chacun, partout. Le Cadre d’indicateurs canadien englobe les 17 objectifs et y ajoute des ambitions et des cibles canadiennes qui ont été élaborées par les ministères fédéraux.
4 changes: 3 additions & 1 deletion translations/fr/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ menu: Menu
## publications: Publications
## reporting_status: Statut de rapport
related-products: Produits connexes
methodology: Méthodologie de mesure des progrès
methodology: Méthodologie de mesure des progrès
more_info: |
Plus d'information
5 changes: 3 additions & 2 deletions translations/fr/status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ moderate_progress: Progrès modéré
negligible_progress: Progrès négligeable
deterioration: Détérioration
moderate_deterioration: Détérioration modérée
significant_deterioration: Détérioration importante
significant_deterioration: Détérioration substantielle
substantial_deterioration: Détérioration substantielle
progress_not_available: Pas disponible
progress-header: <strong>État du progrès</strong>
progress_header: <strong>État du progrès</strong>

0 comments on commit d93ef2b

Please sign in to comment.