Skip to content

Commit

Permalink
Environment-specific logs dir
Browse files Browse the repository at this point in the history
  • Loading branch information
trey-stafford committed Sep 23, 2024
1 parent f3b5f43 commit d082ae3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions seaice_ecdr/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
if not NSIDC_NFS_SHARE_DIR.is_dir():
raise RuntimeError(f"Expected {NSIDC_NFS_SHARE_DIR} to exist, but it does not.")

# Logs from running the ECDR code are saved here.
LOGS_DIR = NSIDC_NFS_SHARE_DIR / f"{ECDR_PRODUCT_VERSION}_logs"


# environment-specific directories for outputs
def _get_env_subdir_str() -> str:
Expand Down Expand Up @@ -58,11 +55,16 @@ def _get_env_subdir_str() -> str:

# Outputs from the `seaice_ecdr` go to these locations by default. The CLI
# provides the option to change this.
_env_subdir = _get_env_subdir_str()
DEFAULT_BASE_OUTPUT_DIR = (
NSIDC_NFS_SHARE_DIR / f"{ECDR_PRODUCT_VERSION}_outputs" / _get_env_subdir_str()
NSIDC_NFS_SHARE_DIR / f"{ECDR_PRODUCT_VERSION}_outputs" / _env_subdir
)
DEFAULT_BASE_OUTPUT_DIR.mkdir(parents=True, exist_ok=True)

# Logs from running the ECDR code are saved here.
LOGS_DIR = NSIDC_NFS_SHARE_DIR / f"{ECDR_PRODUCT_VERSION}_logs" / _env_subdir
LOGS_DIR.mkdir(parents=True, exist_ok=True)

# Location of LANCE AMSR2 NRT data files:
# TODO: nest the subdir under an `ecdr_inputs` or similar?
LANCE_NRT_DATA_DIR = NSIDC_NFS_SHARE_DIR / "lance_amsr2_nrt_data"
Expand Down

0 comments on commit d082ae3

Please sign in to comment.