Skip to content

Commit 1d13df2

Browse files
committed
Don't try to create the model root
1 parent 3d9d306 commit 1d13df2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

scripts/gen_data_pages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
nav = mkdocs_gen_files.Nav() # type: ignore[attr-defined, no-untyped-call]
1616
doc_root = Path()
1717

18-
cdata = ClimateData()
18+
cdata = ClimateData(create_root=False)
1919

2020

2121
def list_to_str(lst: Collection[Any]) -> str:

src/climate_data/data.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,13 @@
2727
class ClimateData:
2828
"""Class for managing the climate data used in the project."""
2929

30-
def __init__(self, root: str | Path = cdc.MODEL_ROOT) -> None:
30+
def __init__(
31+
self, root: str | Path = cdc.MODEL_ROOT, *, create_root: bool = True
32+
) -> None:
3133
self._root = Path(root)
3234
self._credentials_root = self._root / "credentials"
33-
self._create_model_root()
35+
if create_root:
36+
self._create_model_root()
3437

3538
def _create_model_root(self) -> None:
3639
mkdir(self.root, exist_ok=True)

0 commit comments

Comments
 (0)