From dadd5c697a07217913e49d17ce1ea9496e18b53e Mon Sep 17 00:00:00 2001 From: kamangir Date: Mon, 4 Mar 2024 00:18:53 -0800 Subject: [PATCH] logger update - kamangir/bolt#1234 --- .abcli/hubble.sh | 6 ++++++ .abcli/tests/version.sh | 9 +++++++++ hubble/__init__.py | 2 +- hubble/fits.py | 9 +++------ hubble/tests/test_version.py | 5 +++++ notebooks/hst.ipynb | 2 +- 6 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 .abcli/tests/version.sh create mode 100644 hubble/tests/test_version.py diff --git a/.abcli/hubble.sh b/.abcli/hubble.sh index 2260632..1ff7ad3 100755 --- a/.abcli/hubble.sh +++ b/.abcli/hubble.sh @@ -34,6 +34,12 @@ function abcli_hubble() { return fi + if [[ "|pylint|pytest|test|" == *"|$task|"* ]]; then + abcli_${task} plugin=hubble,$2 \ + "${@:3}" + return + fi + python3 -m hubble \ $task \ "${@:2}" diff --git a/.abcli/tests/version.sh b/.abcli/tests/version.sh new file mode 100644 index 0000000..7922a62 --- /dev/null +++ b/.abcli/tests/version.sh @@ -0,0 +1,9 @@ +#! /usr/bin/env bash + +function test_blue_plugin_version() { + local options=$1 + local do_dryrun=$(abcli_option_int "$options" dryrun 0) + + abcli_eval dryrun=$do_dryrun \ + "hubble version ${@:2}" +} diff --git a/hubble/__init__.py b/hubble/__init__.py index 6e58415..5be42e4 100644 --- a/hubble/__init__.py +++ b/hubble/__init__.py @@ -4,4 +4,4 @@ DESCRIPTION = f"{ICON} tools to access and process Hubble Space Telescope imagery and other datasets on AWS Open Data Registry." -VERSION = "3.299.1" +VERSION = "3.301.1" diff --git a/hubble/fits.py b/hubble/fits.py index cae2dff..1ecf4db 100644 --- a/hubble/fits.py +++ b/hubble/fits.py @@ -2,13 +2,10 @@ from typing import List from astropy.io import fits import matplotlib.pyplot as plt -from abcli.plugins.graphics.gif import generate_animated_gif from abcli import file, path -from . import NAME -from abcli import logging -import logging - -logger = logging.getLogger(__name__) +from abcli.plugins.graphics.gif import generate_animated_gif +from hubble import NAME +from hubble.logger import logger def load_fit_file( diff --git a/hubble/tests/test_version.py b/hubble/tests/test_version.py new file mode 100644 index 0000000..30da9dd --- /dev/null +++ b/hubble/tests/test_version.py @@ -0,0 +1,5 @@ +from hubble import VERSION + + +def test_version(): + assert VERSION diff --git a/notebooks/hst.ipynb b/notebooks/hst.ipynb index 86a4def..4b7890b 100644 --- a/notebooks/hst.ipynb +++ b/notebooks/hst.ipynb @@ -33,7 +33,7 @@ "from abcli.plugins import seed\n", "from hubble import NAME, VERSION\n", "from hubble.ingest import ingest\n", - "from abcli.logger import logger\n", + "from hubble.logger import logger\n", "\n", "logger.info(f\"{NAME}.{VERSION}.{fullname()}, built on {string.pretty_date()}\")" ]