Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 Rename gbd_tools.py -> shared.py #1399

Merged
merged 6 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions etl/steps/data/garden/ihme_gbd/2019/gbd_cause.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
from gbd_tools import run_wrapper
from structlog import get_logger

from etl.helpers import PathFinder

from .shared import run_wrapper

# naming conventions
paths = PathFinder(__file__)
log = get_logger()


def run(dest_dir: str) -> None:
# Name the dimensions we are keeping and pivoting by - this varies for gbd_risk
dims = ["sex", "age", "cause"]
dims = ["cause", "sex", "age"]

# Get dataset level variables

Expand Down
5 changes: 3 additions & 2 deletions etl/steps/data/garden/ihme_gbd/2019/gbd_child_mortality.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
from gbd_tools import run_wrapper
from structlog import get_logger

from etl.helpers import PathFinder

from .shared import run_wrapper

# naming conventions
paths = PathFinder(__file__)
log = get_logger()


def run(dest_dir: str) -> None:
# Name the dimensions we are keeping and pivoting by - this varies for gbd_risk
dims = ["sex", "age", "cause"]
dims = ["cause", "sex", "age"]

# Get dataset level variables

Expand Down
6 changes: 4 additions & 2 deletions etl/steps/data/garden/ihme_gbd/2019/gbd_mental_health.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
from gbd_tools import run_wrapper
from structlog import get_logger

from etl.helpers import PathFinder

from .shared import run_wrapper

# naming conventions
paths = PathFinder(__file__)
log = get_logger()


def run(dest_dir: str) -> None:
dims = ["sex", "age", "cause"]
dims = ["cause", "sex", "age"]

# Get dataset level variables
dataset = paths.short_name
log.info(f"{dataset}.start")
Expand Down
5 changes: 3 additions & 2 deletions etl/steps/data/garden/ihme_gbd/2019/gbd_prevalence.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
from gbd_tools import run_wrapper
from structlog import get_logger

from etl.helpers import PathFinder

from .shared import run_wrapper

# naming conventions
paths = PathFinder(__file__)
log = get_logger()


def run(dest_dir: str) -> None:
# Name the dimensions we are keeping and pivoting by - this varies for gbd_risk
dims = ["sex", "age", "cause"]
dims = ["cause", "sex", "age"]

# Get dataset level variables

Expand Down
6 changes: 3 additions & 3 deletions etl/steps/data/garden/ihme_gbd/2019/gbd_risk.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from gbd_tools import run_wrapper
from structlog import get_logger

from etl.helpers import PathFinder

# naming conventions
from .shared import run_wrapper

paths = PathFinder(__file__)
log = get_logger()


def run(dest_dir: str) -> None:
dims = ["sex", "age", "cause", "rei"]
dims = ["cause", "rei", "sex", "age"]
# Get dataset level variables
dataset = paths.short_name
log.info(f"{dataset}.start")
Expand Down
2 changes: 1 addition & 1 deletion etl/steps/data/grapher/ihme_gbd/2019/gbd_cause.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from etl.helpers import PathFinder

from .gbd_tools import run_wrapper
from .shared import run_wrapper

paths = PathFinder(__file__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from etl.helpers import PathFinder

from .gbd_tools import run_wrapper
from .shared import run_wrapper

paths = PathFinder(__file__)

Expand Down
2 changes: 1 addition & 1 deletion etl/steps/data/grapher/ihme_gbd/2019/gbd_mental_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from etl.helpers import PathFinder

from .gbd_tools import run_wrapper
from .shared import run_wrapper

paths = PathFinder(__file__)

Expand Down
2 changes: 1 addition & 1 deletion etl/steps/data/grapher/ihme_gbd/2019/gbd_prevalence.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from etl.helpers import PathFinder

from .gbd_tools import run_wrapper
from .shared import run_wrapper

paths = PathFinder(__file__)

Expand Down
4 changes: 1 addition & 3 deletions etl/steps/data/grapher/ihme_gbd/2019/gbd_risk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

from etl.helpers import PathFinder

from .gbd_tools import run_wrapper
from .shared import run_wrapper

paths = PathFinder(__file__)


def run(dest_dir: str) -> None:
garden_dataset = paths.garden_dataset
dataset = catalog.Dataset.create_empty(dest_dir, garden_dataset.metadata)
# dataset.save()

run_wrapper(garden_dataset=garden_dataset, dataset=dataset)