Skip to content

Commit

Permalink
Deprecate kadi load_ska_dir() in favor of parse_cm load_dir_from_load…
Browse files Browse the repository at this point in the history
…_name()
  • Loading branch information
taldcroft committed Jan 18, 2024
1 parent 0f28614 commit 5fcdf13
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 @@ -1093,14 +1093,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):
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
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)

0 comments on commit 5fcdf13

Please sign in to comment.