From ff2b7fc965e1e18ab7b0cae2381dc0c66e002d82 Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Wed, 21 Jan 2026 23:02:19 -0500 Subject: [PATCH 1/3] Add the ArchiveMCC dir to stk local search path --- cheta/comps/ephem_stk.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/cheta/comps/ephem_stk.py b/cheta/comps/ephem_stk.py index ec0b538c..7e3ac285 100644 --- a/cheta/comps/ephem_stk.py +++ b/cheta/comps/ephem_stk.py @@ -284,20 +284,21 @@ def get_ephem_stk_paths( else EPHEM_STK_DIRS_DEFAULT ) - # First try local STK directories (if they exist) + # First try local STK directories (if they exist), including ArchiveMCC subdir for stk_dir in stk_dirs: - if not stk_dir.exists(): - continue - local_names = [p.name for p in stk_dir.iterdir()] - logger.info(f"Checking local directory {stk_dir} for STK files") - files_stk.extend(find_stk_files(local_names, stk_dir, "local", start, stop)) - if latest_only and any(f["start"] <= start for f in files_stk): - files_stk = sorted(files_stk, key=lambda x: x["start"].date) - for ii, file_stk in enumerate(reversed(files_stk)): - if file_stk["start"] <= start: - files_stk = files_stk[-ii - 1 :] - break - return files_stk + for subdir in [stk_dir, stk_dir / "ArchiveMCC"]: + if not subdir.exists(): + continue + local_names = [p.name for p in subdir.iterdir()] + logger.info(f"Checking local directory {subdir} for STK files") + files_stk.extend(find_stk_files(local_names, subdir, "local", start, stop)) + if latest_only and any(f["start"] <= start for f in files_stk): + files_stk = sorted(files_stk, key=lambda x: x["start"].date) + for ii, file_stk in enumerate(reversed(files_stk)): + if file_stk["start"] <= start: + files_stk = files_stk[-ii - 1 :] + break + return files_stk # Then try OCCweb for dir_path in [EPHEM_STK_RECENT_DIR, EPHEM_STK_ARCHIVE_DIR]: From 4a934e420cd4f59661ddce41e6480b58d6191d4c Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Wed, 21 Jan 2026 23:22:42 -0500 Subject: [PATCH 2/3] Force occweb timeout test to actually use occweb --- cheta/tests/test_comps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cheta/tests/test_comps.py b/cheta/tests/test_comps.py index 4ab036b1..aa843b32 100644 --- a/cheta/tests/test_comps.py +++ b/cheta/tests/test_comps.py @@ -631,7 +631,7 @@ def test_dp_roll_css(): assert np.allclose(vals, exp, rtol=0, atol=2e-4) -def test_stk_ephem_timeout(monkeypatch, tmp_path, clear_lru_cache): +def test_stk_ephem_timeout(monkeypatch, tmp_path, clear_lru_cache, force_stk_files_from_occweb): monkeypatch.setattr( ephem_stk, "EPHEM_STK_CACHE_DIR_DEFAULT", str(tmp_path / "cache") ) From 909373d5aa5743d4a19ebbf100e4601f134eab87 Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Wed, 21 Jan 2026 23:28:20 -0500 Subject: [PATCH 3/3] Ruff format --- cheta/tests/test_comps.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cheta/tests/test_comps.py b/cheta/tests/test_comps.py index aa843b32..de5a1020 100644 --- a/cheta/tests/test_comps.py +++ b/cheta/tests/test_comps.py @@ -631,7 +631,9 @@ def test_dp_roll_css(): assert np.allclose(vals, exp, rtol=0, atol=2e-4) -def test_stk_ephem_timeout(monkeypatch, tmp_path, clear_lru_cache, force_stk_files_from_occweb): +def test_stk_ephem_timeout( + monkeypatch, tmp_path, clear_lru_cache, force_stk_files_from_occweb +): monkeypatch.setattr( ephem_stk, "EPHEM_STK_CACHE_DIR_DEFAULT", str(tmp_path / "cache") )