Skip to content

Commit

Permalink
Use dotenv for configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbit committed Jul 12, 2022
1 parent 1b0e2fd commit 64b8c9f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
8 changes: 6 additions & 2 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import os
from pathlib import Path
from dotenv import load_dotenv

load_dotenv()

# Where the simulations results will be saved.
DATA_PATH = Path(__file__).parent.joinpath('resources/data')
DATA_PATH = Path(os.getenv('ER_DATA_PATH'))
DATA_PATH.mkdir(parents=True, exist_ok=True)

# Where the generated figures will be saved.
FIGURES_PATH = Path(__file__).parent.joinpath('resources/figures')
FIGURES_PATH = Path(os.getenv('ER_FIGURES_PATH'))
FIGURES_PATH.mkdir(parents=True, exist_ok=True)
14 changes: 13 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pyarrow = "^6.0.0"
cmocean = "^2.0"
tqdm = "^4.62.3"
matplotlib = "^3.4.3"
python-dotenv = "^0.20.0"

[tool.poetry.dev-dependencies]
pytest = "^6.2.5"
Expand Down

0 comments on commit 64b8c9f

Please sign in to comment.