From c1dd68a6ebf00a4f0cff6c4d80cfbd5664e60bd0 Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Wed, 10 Jan 2024 08:57:17 -0500 Subject: [PATCH] Revert change to ska_load_dir() in this PR --- kadi/commands/core.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/kadi/commands/core.py b/kadi/commands/core.py index 3c57bb92..ea726063 100644 --- a/kadi/commands/core.py +++ b/kadi/commands/core.py @@ -2,9 +2,9 @@ import calendar import functools import logging +import os import pickle import struct -import warnings import weakref from pathlib import Path @@ -1080,14 +1080,14 @@ def get_par_idx_update_pars_dict(pars_dict, cmd, params=None, rev_pars_dict=None return par_idx -def ska_load_dir(load_name: str) -> Path: - """Return a load directory path in $SKA/data from a load name like "DEC1123B".""" - - warnings.warn( - "ska_load_dir() is deprecated. Use parse_cm.paths.load_dir_from_load_name()", - np.VisibleDeprecationWarning, - stacklevel=2, - ) - from parse_cm.paths import load_dir_from_load_name - - return load_dir_from_load_name(load_name) +def ska_load_dir(load_name): + root = Path(os.environ["SKA"]) / "data" / "mpcrit1" / "mplogs" + year = load_name[5:7] + if year == "99": + year = 1999 + else: + year = 2000 + int(year) + load_rev = load_name[-1].lower() + load_dir = load_name[:-1] + load_dir = root / str(year) / load_dir / f"ofls{load_rev}" + return load_dir