From 4dd8e13d6b4face6a8a39c35d4c8375e21bd4781 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 10 Jan 2024 17:27:48 +0100 Subject: [PATCH] chore(repo): Rename data loading module --- pyproject.toml | 2 +- scoping_review.qmd | 4 ++-- src/{data.py => load_data.py} | 4 ++-- src/{load_yaml.py => yaml.py} | 0 4 files changed, 5 insertions(+), 5 deletions(-) rename src/{data.py => load_data.py} (90%) rename src/{load_yaml.py => yaml.py} (100%) diff --git a/pyproject.toml b/pyproject.toml index 8b52d0c..a5a08ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ cmd = "nvim" [tool.poe.tasks.extract] help = "Extract the csv data from raw yaml files" shell = """ -python src/data.py > 02-data/processed/extracted.csv +python src/load_data.py > 02-data/processed/extracted.csv """ [tool.poe.tasks.milestone] help = "Extract, render, commit and version a finished artifact" diff --git a/scoping_review.qmd b/scoping_review.qmd index 990a79a..776bf37 100644 --- a/scoping_review.qmd +++ b/scoping_review.qmd @@ -57,7 +57,7 @@ bib_sample = bibtexparser.parse_string(bib_string) ```{python} # load relevant studies -from src import data +from src import load_data # load zotero-based metadata: citations and uses zot_df = pd.DataFrame([ @@ -91,7 +91,7 @@ def countries_to_income_groups(countries:str): return ";".join(res) -bib_df = (data.from_yml(f"{PROCESSED_DATA}") +bib_df = (load_data.from_yml(f"{PROCESSED_DATA}") .assign( doi=lambda _df: _df["uri"].str.extract(r"https?://(?:dx\.)?doi\.org/(.*)", expand=False), zot_cited=lambda _df: _df["doi"].map(zot_df["cited"]), diff --git a/src/data.py b/src/load_data.py similarity index 90% rename from src/data.py rename to src/load_data.py index 460b96b..8fddf72 100644 --- a/src/data.py +++ b/src/load_data.py @@ -2,9 +2,9 @@ import io from pathlib import Path import sys try: - import src.load_yaml as yaml # for quarto document scripts + import src.yaml as yaml # for quarto document scripts except ModuleNotFoundError: - import load_yaml as yaml # for directly running the package + import yaml as yaml # for directly running the package from pandas import DataFrame, read_csv DEFAULT_YAML_PATH = Path("02-data/processed") diff --git a/src/load_yaml.py b/src/yaml.py similarity index 100% rename from src/load_yaml.py rename to src/yaml.py