From 8a4c9537913007770244cb974a0a01f63a2852df Mon Sep 17 00:00:00 2001 From: Fiona Spooner Date: Tue, 20 Aug 2024 20:09:47 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Adding=20DRC=20annotation=20(#3159)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * adding DRC annotation * add annotation * update * set index * add annotation * attempting garden * update origins --- .../data/garden/who/latest/monkeypox/__init__.py | 14 +++++++++++++- .../garden/who/latest/monkeypox/monkeypox.meta.yml | 10 ++++++++++ etl/steps/data/grapher/who/latest/monkeypox.py | 1 - 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/etl/steps/data/garden/who/latest/monkeypox/__init__.py b/etl/steps/data/garden/who/latest/monkeypox/__init__.py index 436debea576..966f0b6c971 100644 --- a/etl/steps/data/garden/who/latest/monkeypox/__init__.py +++ b/etl/steps/data/garden/who/latest/monkeypox/__init__.py @@ -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. # @@ -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"]) # diff --git a/etl/steps/data/garden/who/latest/monkeypox/monkeypox.meta.yml b/etl/steps/data/garden/who/latest/monkeypox/monkeypox.meta.yml index 128b2f31433..47a9ab935ea 100644 --- a/etl/steps/data/garden/who/latest/monkeypox/monkeypox.meta.yml +++ b/etl/steps/data/garden/who/latest/monkeypox/monkeypox.meta.yml @@ -5,6 +5,7 @@ definitions: topic_tags: - Mpox (monkeypox) + dataset: update_period_days: 365 @@ -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 @@ -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 @@ -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 @@ -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: '' diff --git a/etl/steps/data/grapher/who/latest/monkeypox.py b/etl/steps/data/grapher/who/latest/monkeypox.py index 697d5f1da22..9a157d6bb54 100644 --- a/etl/steps/data/grapher/who/latest/monkeypox.py +++ b/etl/steps/data/grapher/who/latest/monkeypox.py @@ -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.