Skip to content

Commit

Permalink
added logging to test
Browse files Browse the repository at this point in the history
  • Loading branch information
christinahedges committed Jan 7, 2025
1 parent 37f58b2 commit 51556de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ all: isort black flake8 pytest

# Run the unit tests using `pytest`
pytest:
poetry run pytest src tests
poetry run pytest src tests --log-cli-level=DEBUG

# Lint the code using `flake8`
flake8:
Expand Down
5 changes: 4 additions & 1 deletion src/lkspacecraft/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from astropy.utils.data import download_file, import_file_to_cache, is_url_in_cache
from tqdm import tqdm

from . import KERNELDIR, PACKAGEDIR
from . import log

KERNELS = {
"naif0012.tls": "https://naif.jpl.nasa.gov/pub/naif/generic_kernels/lsk/",
Expand Down Expand Up @@ -56,9 +56,11 @@ def get_file_paths():
file_names = list(KERNELS.keys())
progress_bar = None
for idx, file_name in enumerate(file_names):
log.debug(f"Finding {file_name}.")
url = KERNELS[file_name]
if is_url_in_cache(url + file_name, pkgname="lkspacecraft"):
file_paths.append(get_file_path(url + file_name))
log.debug(f"Found {file_name} in cache.")
continue
if progress_bar is None:
progress_bar = tqdm(
Expand All @@ -70,6 +72,7 @@ def get_file_paths():
file_paths.append(get_file_path(url + file_name))
progress_bar.n = idx
progress_bar.refresh()
log.debug(f"Downloaded {file_name}.")
return file_paths


Expand Down

0 comments on commit 51556de

Please sign in to comment.