From a29608f1b660b64e964f92d00f1aa2eb6db7c070 Mon Sep 17 00:00:00 2001 From: Christina Hedges Date: Tue, 7 Jan 2025 11:56:59 -0500 Subject: [PATCH] update test --- README.rst | 16 ++++++++++++ poetry.lock | 51 ++++++++++++++++++++++++++++++++++++++- pyproject.toml | 1 + src/lkspacecraft/utils.py | 8 +++--- 4 files changed, 71 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 65659f2..63733da 100644 --- a/README.rst +++ b/README.rst @@ -60,6 +60,7 @@ installing via poetry pip install --upgrade poetry poetry install . + Usage ----- @@ -159,6 +160,21 @@ TESS kernels can be obtained from MAST: https://archive.stsci.edu/missions/tess/engineering/ https://archive.stsci.edu/missions/tess/models/ +When you first load `lkspacecraft` into Python all the kernels will be downloaded for you. This will take approximately 5 minutes, depending on your internet connection. Once this has been done, the kernels will be cached. If there are new TESS kernels available `lkspacecraft` will retrieve them for you and update the cache. + +The total file volume for the kernels is ~1GB. These cached files are stored using `astropy`'s cache. If you want to clear the cache you can do either of the following; + +```python +from lkspacecraft.utils import clear_download_cache +clear_download_cache() +``` + +```python +from astropy.utils.data import clear_download_cache +clear_download_cache(pkgname='lkspacecraft') +``` + + Extending ``lkspacecraft`` ~~~~~~~~~~~~~~~~~~~~~ diff --git a/poetry.lock b/poetry.lock index 65ccd74..022025b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1110,6 +1110,22 @@ files = [ [package.extras] devel = ["colorama", "json-spec", "jsonschema", "pylint", "pytest", "pytest-benchmark", "pytest-cache", "validictory"] +[[package]] +name = "flake8" +version = "7.1.1" +description = "the modular source code checker: pep8 pyflakes and co" +optional = false +python-versions = ">=3.8.1" +files = [ + {file = "flake8-7.1.1-py2.py3-none-any.whl", hash = "sha256:597477df7860daa5aa0fdd84bf5208a043ab96b8e96ab708770ae0364dd03213"}, + {file = "flake8-7.1.1.tar.gz", hash = "sha256:049d058491e228e03e67b390f311bbf88fce2dbaa8fa673e7aea87b7198b8d38"}, +] + +[package.dependencies] +mccabe = ">=0.7.0,<0.8.0" +pycodestyle = ">=2.12.0,<2.13.0" +pyflakes = ">=3.2.0,<3.3.0" + [[package]] name = "fonttools" version = "4.55.3" @@ -2466,6 +2482,17 @@ files = [ [package.dependencies] traitlets = "*" +[[package]] +name = "mccabe" +version = "0.7.0" +description = "McCabe checker, plugin for flake8" +optional = false +python-versions = ">=3.6" +files = [ + {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, + {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, +] + [[package]] name = "mdurl" version = "0.1.2" @@ -3261,6 +3288,17 @@ files = [ [package.extras] tests = ["pytest"] +[[package]] +name = "pycodestyle" +version = "2.12.1" +description = "Python style guide checker" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pycodestyle-2.12.1-py2.py3-none-any.whl", hash = "sha256:46f0fb92069a7c28ab7bb558f05bfc0110dac69a0cd23c61ea0040283a9d78b3"}, + {file = "pycodestyle-2.12.1.tar.gz", hash = "sha256:6838eae08bbce4f6accd5d5572075c63626a15ee3e6f842df996bf62f6d73521"}, +] + [[package]] name = "pycparser" version = "2.22" @@ -3326,6 +3364,17 @@ numpy = ">=1.19.3" docs = ["sphinx-astropy (>=1.3)"] test = ["pytest", "pytest-doctestplus (>=0.7)"] +[[package]] +name = "pyflakes" +version = "3.2.0" +description = "passive checker of Python programs" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pyflakes-3.2.0-py2.py3-none-any.whl", hash = "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"}, + {file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"}, +] + [[package]] name = "pygments" version = "2.18.0" @@ -4978,4 +5027,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = ">=3.10,<4.0" -content-hash = "5b5df7913e1dd60bdcb6bba024ae1c21ec3d0182109960a6ffd290c69e297641" +content-hash = "49605609f3bc4c2fe93335f74e3e68745972ebf1b1257f887ce3b7d7b3726329" diff --git a/pyproject.toml b/pyproject.toml index 0bf7c67..9c2bb82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,6 +31,7 @@ pydata-sphinx-theme = "^0.16.1" sphinx-autobuild = "^2024.10.3" ghp-import = "^2.1.0" lxml = "^5.3.0" +flake8 = "^7.1.1" [build-system] requires = ["poetry-core"] diff --git a/src/lkspacecraft/utils.py b/src/lkspacecraft/utils.py index 7052ec2..ac2519e 100644 --- a/src/lkspacecraft/utils.py +++ b/src/lkspacecraft/utils.py @@ -69,10 +69,10 @@ def get_file_paths(): total=len(file_names), desc="Downloading SPICE Kernels", ) - file_paths.append(get_file_path(url + file_name)) - progress_bar.n = idx - progress_bar.refresh() - log.debug(f"Downloaded {file_name}.") + 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