Skip to content

Commit

Permalink
Revert change to ska_load_dir() in this PR
Browse files Browse the repository at this point in the history
  • Loading branch information
taldcroft committed Jan 10, 2024
1 parent 9324a5b commit c1dd68a
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions kadi/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import calendar
import functools
import logging
import os
import pickle
import struct
import warnings
import weakref
from pathlib import Path

Expand Down Expand Up @@ -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

0 comments on commit c1dd68a

Please sign in to comment.