fix(code): Update to new data load module name

This commit is contained in:
Marty Oehme 2024-01-18 10:56:39 +01:00
parent 1ad004695c
commit 11db6575ba
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
2 changed files with 6 additions and 6 deletions

View file

@ -7,9 +7,9 @@ title: Grab yml
```{python} ```{python}
import pandas as pd import pandas as pd
from src import data from src import load_data
df = data.from_yml() df = load_data.from_yml()
``` ```
Get interventions: Get interventions:
@ -208,7 +208,7 @@ bib_sample = bibtexparser.parse_string(bib_string)
```{python} ```{python}
# load relevant studies # load relevant studies
from src import data from src import load_data
# load zotero-based metadata: citations and uses # load zotero-based metadata: citations and uses
zot_df = pd.DataFrame([ zot_df = pd.DataFrame([
@ -225,7 +225,7 @@ zot_df = pd.DataFrame([
WB_COUNTRY_GROUPS_FILE = Path(f"{SUPPLEMENTARY_DATA}/wb-country-groupings.xlsx").resolve() WB_COUNTRY_GROUPS_FILE = Path(f"{SUPPLEMENTARY_DATA}/wb-country-groupings.xlsx").resolve()
df_country_groups = pd.read_excel(WB_COUNTRY_GROUPS_FILE).set_index("Economy") df_country_groups = pd.read_excel(WB_COUNTRY_GROUPS_FILE).set_index("Economy")
bib_df = (data.from_yml(f"{PROCESSED_DATA}") bib_df = (load_data.from_yml(f"{PROCESSED_DATA}")
.assign( .assign(
doi=lambda _df: _df["uri"].str.extract(r"https?://(?:dx\.)?doi\.org/(.*)", expand=False), doi=lambda _df: _df["uri"].str.extract(r"https?://(?:dx\.)?doi\.org/(.*)", expand=False),
zot_cited=lambda _df: _df["doi"].map(zot_df["cited"]), zot_cited=lambda _df: _df["doi"].map(zot_df["cited"]),

View file

@ -49,7 +49,7 @@ for partial_bib in WORKING_DATA.glob("**/*.bib"):
bib_sample = bibtexparser.parse_string(bib_string) bib_sample = bibtexparser.parse_string(bib_string)
# load relevant studies # load relevant studies
from src import data from src import load_data
# load zotero-based metadata: citations and uses # load zotero-based metadata: citations and uses
zot_df = pd.DataFrame([ zot_df = pd.DataFrame([
@ -66,7 +66,7 @@ zot_df = pd.DataFrame([
WB_COUNTRY_GROUPS_FILE = Path(f"{SUPPLEMENTARY_DATA}/wb-country-groupings.xlsx").resolve() WB_COUNTRY_GROUPS_FILE = Path(f"{SUPPLEMENTARY_DATA}/wb-country-groupings.xlsx").resolve()
df_country_groups = pd.read_excel(WB_COUNTRY_GROUPS_FILE).set_index("Economy") df_country_groups = pd.read_excel(WB_COUNTRY_GROUPS_FILE).set_index("Economy")
bib_df = (data.from_yml(f"{PROCESSED_DATA}/relevant") bib_df = (load_data.from_yml(f"{PROCESSED_DATA}/relevant")
.assign( .assign(
doi=lambda _df: _df["uri"].str.extract(r"https?://(?:dx\.)?doi\.org/(.*)", expand=False), doi=lambda _df: _df["uri"].str.extract(r"https?://(?:dx\.)?doi\.org/(.*)", expand=False),
zot_cited=lambda _df: _df["doi"].map(zot_df["cited"]), zot_cited=lambda _df: _df["doi"].map(zot_df["cited"]),