From c1eccee426328dc4501841d7d817204d4f32a4c6 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 15 Jul 2024 10:55:46 +0200 Subject: [PATCH] fix(code): Get data dirs relative to project dir --- 01-codechunks/_prep-data.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/01-codechunks/_prep-data.py b/01-codechunks/_prep-data.py index 416ffde..bfb1c02 100644 --- a/01-codechunks/_prep-data.py +++ b/01-codechunks/_prep-data.py @@ -1,4 +1,5 @@ from pathlib import Path +import os import re ## standard imports from IPython.core.display import Markdown as md @@ -11,7 +12,8 @@ import bibtexparser sns.set_style("whitegrid") -DATA_DIR=Path("./02-data") +PROJECT_DIR=Path(os.getenv("QUARTO_PROJECT_DIR", ".")) +DATA_DIR=PROJECT_DIR.joinpath("02-data") RAW_DATA=DATA_DIR.joinpath("raw") WORKING_DATA=DATA_DIR.joinpath("intermediate") PROCESSED_DATA=DATA_DIR.joinpath("processed")