2023-11-17 10:20:26 +00:00
|
|
|
"""Warning: SIM_OUTPUT is a mutable global variable for the simulation output directory."""
|
2023-09-06 11:35:41 +01:00
|
|
|
from datetime import datetime
|
2023-11-17 10:20:26 +00:00
|
|
|
from pathlib import Path
|
2023-09-06 11:35:41 +01:00
|
|
|
|
2023-08-07 19:33:52 +01:00
|
|
|
from primaite import _PRIMAITE_ROOT
|
|
|
|
|
|
2023-11-17 10:20:26 +00:00
|
|
|
__all__ = ["SIM_OUTPUT"]
|
2023-09-06 11:35:41 +01:00
|
|
|
|
2023-11-17 10:20:26 +00:00
|
|
|
|
|
|
|
|
class __SimOutput:
|
|
|
|
|
def __init__(self):
|
|
|
|
|
self._path: Path = (
|
|
|
|
|
_PRIMAITE_ROOT.parent.parent / "simulation_output" / datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def path(self) -> Path:
|
|
|
|
|
return self._path
|
|
|
|
|
|
|
|
|
|
@path.setter
|
|
|
|
|
def path(self, new_path: Path) -> None:
|
|
|
|
|
self._path = new_path
|
|
|
|
|
self._path.mkdir(exist_ok=True, parents=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SIM_OUTPUT = __SimOutput()
|