Skip to content

Commit

Permalink
✨ Adding DRC annotation (#3159)
Browse files Browse the repository at this point in the history
* adding DRC annotation

* add annotation

* update

* set index

* add annotation

* attempting garden

* update origins
  • Loading branch information
spoonerf authored Aug 20, 2024
1 parent d8690b6 commit 8a4c953
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
14 changes: 13 additions & 1 deletion etl/steps/data/garden/who/latest/monkeypox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def run(dest_dir: str) -> None:
# Read table from meadow dataset.
tb = ds_meadow["monkeypox"].reset_index()
tb_suspected = ds_suspected["africa_cdc"].reset_index()

origins = tb["total_conf_cases"].metadata.origins
#
# Process data.
#
Expand All @@ -54,6 +54,18 @@ def run(dest_dir: str) -> None:
)

tb_both = pr.merge(tb, tb_suspected, on=["country", "date"], how="outer")

# For variables on deaths we should show that data reported by the WHO show _only_ confirmed cases, in an annotation
country_mask = tb_both["country"] == "Democratic Republic of Congo"
tb_both["annotation"] = ""
for col in tb_both.columns:
if "deaths" in col:
# Update the annotation column for matching rows
tb_both.loc[country_mask, "annotation"] = (
tb_both.loc[country_mask, "annotation"]
+ "Democratic Republic of Congo: Includes only confirmed deaths as reported by WHO"
)
tb_both["annotation"].metadata.origins = origins
tb_both = tb_both.format(["country", "date"])

#
Expand Down
10 changes: 10 additions & 0 deletions etl/steps/data/garden/who/latest/monkeypox/monkeypox.meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ definitions:
topic_tags:
- Mpox (monkeypox)


dataset:
update_period_days: 365

Expand All @@ -21,6 +22,7 @@ tables:
unit: deaths
display:
numDecimalPlaces: 0
entityAnnotationsMap: "Democratic Republic of Congo: Includes only confirmed deaths as reported by WHO"
new_cases:
title: New confirmed cases
unit: cases
Expand All @@ -31,6 +33,7 @@ tables:
unit: deaths
display:
numDecimalPlaces: 0
entityAnnotationsMap: "Democratic Republic of Congo: Includes only confirmed deaths as reported by WHO"
new_cases_smoothed:
title: New confirmed cases (7-day smoothed)
unit: cases
Expand All @@ -41,6 +44,7 @@ tables:
unit: deaths
display:
numDecimalPlaces: 2
entityAnnotationsMap: "Democratic Republic of Congo: Includes only confirmed deaths as reported by WHO"
new_cases_per_million:
title: New confirmed cases per million
unit: cases per million
Expand All @@ -61,16 +65,22 @@ tables:
unit: deaths per million
display:
numDecimalPlaces: 3
entityAnnotationsMap: "Democratic Republic of Congo: Includes only confirmed deaths as reported by WHO"
total_deaths_per_million:
title: Total confirmed deaths per million
unit: deaths per million
display:
numDecimalPlaces: 3
entityAnnotationsMap: "Democratic Republic of Congo: Includes only confirmed deaths as reported by WHO"
new_deaths_smoothed_per_million:
title: New confirmed deaths per million (7-day smoothed)
unit: deaths per million
display:
numDecimalPlaces: 3
entityAnnotationsMap: "Democratic Republic of Congo: Includes only confirmed deaths as reported by WHO"
iso_code:
title: ISO code
unit: ''
annotation:
title: Annotation
unit: ''
1 change: 0 additions & 1 deletion etl/steps/data/grapher/who/latest/monkeypox.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def run(dest_dir: str) -> None:
# Read table from garden dataset.
tb = ds_garden["monkeypox"]

#
# Save outputs.
#
# Create a new grapher dataset with the same metadata as the garden dataset.
Expand Down

0 comments on commit 8a4c953

Please sign in to comment.