sot / kadi

Chandra commands and events
https://sot.github.io/kadi
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

Cache starcat and other goodies #226

Closed taldcroft closed 2 years ago

taldcroft commented 2 years ago

Description

This is hodge-podge PR that makes improvements related to getting star catalogs from the commands archive.

Fixes #228

Interface impacts

Two API changes as noted above.

Testing

Unit tests

Independent check of unit tests by Jean

Functional tests

Caching control

After removing ~/.kadi/starcats.db, I ran the code below and confirmed that the cache was NOT created, as expected:

from kadi.commands import get_starcats, conf
with conf.set_temp('cache_starcats', False):
    starcats = get_starcats(start='2020:001', stop='2020:100')

Then I did the same starcats = ... command but with caching enabled (the default) and confirmed that the file was created and that the expected performance improvement was seen on subsequent queries.

HTTP exceptions

Testing of d1d30fd consisted of:

taldcroft commented 2 years ago

@jeanconn @javierggt - this is ready (I hope!) for final review.

taldcroft commented 2 years ago

@jeanconn - I think the comments you made have been addressed.