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

General Path Definitions Using pathlib #15

Open
RogerGMarch opened this issue Jan 29, 2025 · 0 comments
Open

General Path Definitions Using pathlib #15

RogerGMarch opened this issue Jan 29, 2025 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@RogerGMarch
Copy link
Collaborator

A general config file is needed to manage the paths in a path.py or config.toml depends on variables instead of full paths.

example in models folder:

from pathlib import Path

BASE_DIR = Path(__file__).resolve().parents[1]  # This goes up two levels to the project root

# Define paths dictionary relative to BASE_DIR
PATH = {
    "parameters": BASE_DIR / "parameters",
    "data": BASE_DIR / "bikenwgrowth_external" / "data",
    "plots": BASE_DIR / "bikenwgrowth_external" / "plots",
    "plots_networks": BASE_DIR / "bikenwgrowth_external" / "plotsnetworks",
    "results": BASE_DIR / "bikenwgrowth_external" / "results",
    "results_constricted": BASE_DIR / "bikenwgrowth_external" / "results_constricted",
    "videos": BASE_DIR / "bikenwgrowth_external" / "videos",
    "exports": BASE_DIR / "bikenwgrowth_external" / "exports",
    "exports_json": BASE_DIR / "bikenwgrowth_external" / "exports_json",
    "logs": BASE_DIR / "bikenwgrowth_external" / "logs",
}
@RogerGMarch RogerGMarch added enhancement New feature or request good first issue Good for newcomers labels Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant