Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set acq stats processing to continue on individual obsid exceptions #291

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions mica/stats/tests/test_acq_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ def test_calc_stats():
acq_stats.calc_stats(4911)
acq_stats.calc_stats(19386)

# This one raises a ValueError
with pytest.raises(ValueError):
acq_stats.calc_stats(29211)

# This one raises an IndexError
with pytest.raises(IndexError):
acq_stats.calc_stats(62620)


@pytest.mark.skipif(not HAS_OBSPAR_ARCHIVE, reason='Test requires mica obspars')
def test_make_acq_stats():
Expand Down
2 changes: 1 addition & 1 deletion mica/stats/update_acq_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ def update(opt):
logger.info("Processing obsid {}".format(obsid))
try:
obsid_info, acq_stats, star_info, catalog, temp = calc_stats(obsid)
except ValueError as e:
except Exception as e:
logger.info("Skipping obsid {}: {}".format(obsid, e))
continue
if not len(acq_stats):
Expand Down