From 40a3df132a301f39323ffd38d7c33874645494a5 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 5 Dec 2023 16:42:20 +0100 Subject: [PATCH] chore(repo): Fix links to bibtex file Fixed any relative links to the bibtex file for generating annotations or similar. --- 00-notebooks/bibmanip.qmd | 117 ++++++++++++++++++++++++++++++++++++++ notes.md | 2 +- scoping_review.qmd | 2 +- 3 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 00-notebooks/bibmanip.qmd diff --git a/00-notebooks/bibmanip.qmd b/00-notebooks/bibmanip.qmd new file mode 100644 index 0000000..56f12e0 --- /dev/null +++ b/00-notebooks/bibmanip.qmd @@ -0,0 +1,117 @@ +--- +bibliography: ../02-data/supplementary/lib.bib +csl: /home/marty/documents/library/utilities/styles/APA-7.csl +papersize: A4 +linestretch: 1.5 +fontfamily: lmodern +fontsize: "12" +geometry: + - left=2.2cm + - right=3.5cm + - top=2.5cm + - bottom=2.5cm +toc: false +link-citations: true +link-bibliography: true +number-sections: false +lang: en +title: Scoping review on 'what works' +subtitle: Addressing inequalities in the World of Work +--- + +```{python} +#| echo: false +from pathlib import Path +data_dir=Path("../02-data") + +## standard imports +from IPython.core.display import Markdown as md +import numpy as np +import pandas as pd +from matplotlib import pyplot as plt +import seaborn as sns +from tabulate import tabulate +``` + +```{python} +sns.set_style("whitegrid") +``` + +```{python} +#| echo: false +# load and parse overall bibtex sample +import bibtexparser + +bib_string="" +print(f"path: {data_dir.joinpath('raw/01_wos-sample_2023-11-02').absolute()}") +for partial_bib in data_dir.joinpath("raw/01_wos-sample_2023-11-02").glob("*.bib"): + with open(partial_bib) as f: + bib_string+="\n".join(f.readlines()) +sample = bibtexparser.parse_string(bib_string) +``` + +## Description of results + +```{python} +#| echo: false + +sample_size = len(sample.entries) +md(f""" +The exploratory execution of queries results in an initial sample of {sample_size} studies after the identification process. +""") +``` + +yrs: + +```{python} +reformatted = [] +for e in sample.entries: + reformatted.append([e["Year"], e["Author"], e["Title"], e["Type"], e["Times-Cited"], e["Usage-Count-Since-2013"]]) +bib_df = pd.DataFrame(reformatted, columns = ["Year", "Author", "Title", "Type", "Cited", "Usage"]) +bib_df["Date"] = pd.to_datetime(bib_df["Year"], format="%Y") +bib_df["Year"] = bib_df["Date"].dt.year +bib_df +``` + +```{python} +# RESTRICT FOR NEWER STUDIES +bib_df = bib_df[bib_df["Year"] >= 2000] +``` + +Publications per year: + +```{python} +ax = sns.countplot(bib_df[bib_df["Year"] >= 2000], x="Year") +ax.tick_params(axis='x', rotation=45) +plt.tight_layout() +plt.show() +``` + +By type: + +```{python} +bib_df["Type"].value_counts() +bib_df["Literature"] = np.where(bib_df["Type"].str.contains("article", case=False, regex=False), "white", "gray") +bib_df["Literature"] = bib_df["Literature"].astype("category") +``` + +Per type: + +```{python} +ax = sns.countplot(bib_df[bib_df["Year"] >= 2000], x="Year", hue="Literature") +ax.tick_params(axis='x', rotation=45) +# ax.set_xlabel("") +plt.tight_layout() +plt.show() +``` + +Avg num of citations: + +```{python} +bib_df["Cited"] = bib_df["Cited"].astype("int") +grpd = bib_df.groupby(["Year"], as_index=False)["Cited"].mean() +ax = sns.barplot(grpd, x="Year", y="Cited") +ax.tick_params(axis='x', rotation=45) +plt.tight_layout() +plt.show() +``` diff --git a/notes.md b/notes.md index 37f546e..a5f7b38 100644 --- a/notes.md +++ b/notes.md @@ -1,5 +1,5 @@ --- -bibliography: 03-supplementary_data/lib.bib +bibliography: 02-data/supplementary/lib.bib csl: /home/marty/documents/library/utilities/styles/APA-7.csl papersize: A4 linestretch: 1.5 diff --git a/scoping_review.qmd b/scoping_review.qmd index abd2cc1..c0aa270 100644 --- a/scoping_review.qmd +++ b/scoping_review.qmd @@ -1,5 +1,5 @@ --- -bibliography: 03-supplementary_data/lib.bib +bibliography: 02-data/supplementary/lib.bib csl: /home/marty/documents/library/utilities/styles/APA-7.csl papersize: A4 linestretch: 1.5