Skip to content

Commit

Permalink
births by decade grapher step
Browse files Browse the repository at this point in the history
  • Loading branch information
spoonerf committed Oct 1, 2024
1 parent ab0f6ad commit d265185
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dag/demography.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,5 @@ steps:
# Mothers by age-group
data://garden/un/2024-10-01/births_by_age:
- data://garden/un/2024-07-12/un_wpp
data://grapher/un/2024-10-01/births_by_age:
- data://garden/un/2024-10-01/births_by_age
29 changes: 29 additions & 0 deletions etl/steps/data/grapher/un/2024-10-01/un_wpp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from etl.helpers import PathFinder, create_dataset

# Get paths and naming conventions for current step.
paths = PathFinder(__file__)


def run(dest_dir: str) -> None:
#
# Load inputs.
#
# Load garden dataset.
ds_garden = paths.load_dataset("births_by_age")
#
# Process data.
#
tb = ds_garden["births"]
#
# Save outputs.
#
# Create grapher dataset
ds_grapher = create_dataset(
dest_dir,
tables=[tb],
check_variables_metadata=True,
default_metadata=ds_garden.metadata,
)

# Save changes in the new grapher dataset.
ds_grapher.save()

0 comments on commit d265185

Please sign in to comment.