diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 7cc8731..e31954b 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -1,12 +1,22 @@ --- name: CI Tests + on: - push: - branches: - - main - pull_request: null + workflow_dispatch: + pull_request: + branches: [ main, develop ] + schedule: + # run every Monday at 6am UTC + - cron: '0 6 * * 1' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: - SETUP_XVFB: true + SETUP_XVFB: True # avoid issues if mpl tries to open a GUI window + TOXARGS: '-v' + jobs: ci-tests: name: Tox env ${{ matrix.python }}-${{ matrix.toxenv }} @@ -36,6 +46,9 @@ jobs: - name: Test with tox run: | tox -e ${{ matrix.python }}-${{ matrix.toxenv }} + - name: Upload coverage to codecov + if: "endsWith(matrix.tox_env, '-cov')" + uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0 os-tests: name: Python ${{ matrix.python }} on ${{ matrix.os }} permissions: diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index e46d0e6..09a3b0b 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,10 +1,7 @@ name: Docs on: - push: null - pull_request: - types: - - opened - workflow_dispatch: null + push: + workflow_dispatch: permissions: contents: write diff --git a/doc/deveny_ql.rst b/doc/deveny_ql.rst new file mode 100644 index 0000000..f517ece --- /dev/null +++ b/doc/deveny_ql.rst @@ -0,0 +1,25 @@ +.. include:: include/links.rst + +.. |nbsp| unicode:: 0xA0 + :trim: + +.. _deveny_ql: + +=============================== +DeVeny Spectrum Quick Look Tool +=============================== + +Status: *Planned* + +Overview +======== + + - ``deveny_ql``: A quick-look tool is needed for DeVeny spectra that can + show recently acquired spectra with rudimentary processing. This tool + will be based on other PypeIt QL tools. + + +Usage +===== + +Usage information will be added here once this tool enters development. diff --git a/doc/help/deveny_collfocus.rst b/doc/help/deveny_collfocus.rst index 494c811..991c076 100644 --- a/doc/help/deveny_collfocus.rst +++ b/doc/help/deveny_collfocus.rst @@ -7,4 +7,6 @@ options: -h, --help show this help message and exit + + LDT Observer Tools (obstools) version 0.6.7 \ No newline at end of file diff --git a/doc/help/deveny_grangle.rst b/doc/help/deveny_grangle.rst index a8ff66a..1793cd4 100644 --- a/doc/help/deveny_grangle.rst +++ b/doc/help/deveny_grangle.rst @@ -10,4 +10,6 @@ --cli Use the command-line version of this tool (default: False) --max Use the MAX version of the GUI (compute wavelength from angle) (default: False) + + LDT Observer Tools (obstools) version 0.6.7 \ No newline at end of file diff --git a/doc/help/dfocus.rst b/doc/help/dfocus.rst index 0b22686..e27dc07 100644 --- a/doc/help/dfocus.rst +++ b/doc/help/dfocus.rst @@ -10,4 +10,6 @@ --flog FLOG focus log to use (default: last) --thresh THRESH threshold for line detection (default: 100.0) --nodisplay DO NOT launch Preview.app to display plots (default: False) + + LDT Observer Tools (obstools) version 0.6.7 \ No newline at end of file diff --git a/doc/help/fix_ldt_header.rst b/doc/help/fix_ldt_header.rst index c79ff78..e2deefa 100644 --- a/doc/help/fix_ldt_header.rst +++ b/doc/help/fix_ldt_header.rst @@ -12,4 +12,6 @@ options: -h, --help show this help message and exit + + LDT Observer Tools (obstools) version 0.6.7 \ No newline at end of file diff --git a/doc/help/lmi_etc.rst b/doc/help/lmi_etc.rst index 47b55f2..14a65e6 100644 --- a/doc/help/lmi_etc.rst +++ b/doc/help/lmi_etc.rst @@ -7,4 +7,6 @@ options: -h, --help show this help message and exit + + LDT Observer Tools (obstools) version 0.6.7 \ No newline at end of file diff --git a/doc/help/neocp_ephem.rst b/doc/help/neocp_ephem.rst index 552223b..a8988b6 100644 --- a/doc/help/neocp_ephem.rst +++ b/doc/help/neocp_ephem.rst @@ -10,4 +10,6 @@ options: -h, --help show this help message and exit + + LDT Observer Tools (obstools) version 0.6.7 \ No newline at end of file diff --git a/doc/help/scrub_deveny_pickup.rst b/doc/help/scrub_deveny_pickup.rst index 054a64f..fe483d7 100644 --- a/doc/help/scrub_deveny_pickup.rst +++ b/doc/help/scrub_deveny_pickup.rst @@ -22,4 +22,6 @@ -d, --diagnostics Output additional information and plots during the analysis for debugging purposes (default: False) -n, --no_refit Force no refit of 'bad' RMS values (default: False) + + LDT Observer Tools (obstools) version 0.6.7 \ No newline at end of file diff --git a/doc/include/dependencies_table.rst b/doc/include/dependencies_table.rst index 86cd76b..2dec0a4 100644 --- a/doc/include/dependencies_table.rst +++ b/doc/include/dependencies_table.rst @@ -1,6 +1,6 @@ ================================ ================================================================================================================================================================================================================================= Python Version ``>=3.10,<3.13`` -Required for users ``PySimpleGUI-4-foss``, ``astropy>=5.1``, ``ccdproc``, ``darkdetect``, ``matplotlib``, ``numpy>=1.24,<2.0.0``, ``requests``, ``scipy>=1.9``, ``setuptools``, ``setuptools_scm``, ``tqdm`` +Required for users ``PySimpleGUI-4-foss``, ``astropy>=6.0``, ``ccdproc``, ``darkdetect``, ``matplotlib``, ``numpy>=1.24,<2.0``, ``requests``, ``scipy``, ``setuptools``, ``setuptools_scm``, ``tqdm`` Optional ``pypeit`` requirements ``pypeit[specutils]>=1.15.0`` Required for developers ``black``, ``pylint``, ``pypeit[specutils]>=1.15.0``, ``pytest-astropy``, ``pytest>=7.0.0``, ``pyyaml``, ``sphinx-automodapi``, ``sphinx-subfigure``, ``sphinx>=1.6``, ``sphinx_rtd_theme``, ``stomp.py``, ``tox``, ``xmltodict`` ================================ ================================================================================================================================================================================================================================= diff --git a/doc/index.rst b/doc/index.rst index d45dca8..99a3488 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -22,6 +22,7 @@ Dependencies Table :hidden: Exposure Time Calculator + LMI Quick Look Tool .. toctree:: :caption: DeVeny Tools @@ -32,6 +33,7 @@ Dependencies Table Collimator Focus Sequence Estimator Collimator Focus Calculator Pickup Noise Scrubber + DeVeny Spectrum Quick Look Tool .. toctree:: :caption: General LDT Tools diff --git a/doc/lmi_ql.rst b/doc/lmi_ql.rst new file mode 100644 index 0000000..24e1d61 --- /dev/null +++ b/doc/lmi_ql.rst @@ -0,0 +1,27 @@ +.. include:: include/links.rst + +.. |nbsp| unicode:: 0xA0 + :trim: + +.. _lmi_ql: + +========================= +LMI Image Quick Look Tool +========================= + +Status: *Planned* + +Overview +======== + + - ``lmi_ql``: A quick-look tool is needed for LMI images that can show + recently acquired images with a simple bias-subtraction and flat-division. + This tool will likely be based on [Ginga]( + https://ginga.readthedocs.io/en/stable/) and development can be guided by + following some of the image-viewer steps included in PypeIt. + + +Usage +===== + +Usage information will be added here once this tool enters development. diff --git a/doc/scripts/write_script_help.py b/doc/scripts/write_script_help.py index 0c067fb..b8746a0 100644 --- a/doc/scripts/write_script_help.py +++ b/doc/scripts/write_script_help.py @@ -42,6 +42,8 @@ def write_help(script_cls: utils.ScriptBase, opath: pathlib.Path, width: int = 8 parser = script_cls.get_parser(width=width) parser.prog = exe lines += [" " + l for l in parser.format_help().split("\n")] + # Remove ".dev....." junk from the version + lines[-2] = lines[-2].split('.dev')[0] print(f"Writing: {ofile}") with open(ofile, "w", encoding="utf-8") as f_obj: f_obj.write("\n".join(lines)) diff --git a/obstools/tests/files/.gitkeep b/obstools/tests/files/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/obstools/utils.py b/obstools/utils.py index 7e4d461..03b9e4b 100644 --- a/obstools/utils.py +++ b/obstools/utils.py @@ -531,10 +531,7 @@ def entry_point(cls): Defines the main script entry point. """ args = cls.parse_args() - if args.version: - print(f" LDT Observer Tools (obstools) version {__version__}") - else: - sys.exit(cls.main(args)) + sys.exit(cls.main(args)) @classmethod @property @@ -552,14 +549,10 @@ def parse_args(cls, options=None): """ parser = cls.get_parser() ScriptBase._fill_parser_cwd(parser) - # Add "--version" to bottom of all scripts - parser.add_argument( - "--version", action="store_true", help="Print version and exit" - ) - return parser.parse_args() if options is None else parser.parse_args(options) + return parser.parse_args(options) @staticmethod - def _fill_parser_cwd(parser): + def _fill_parser_cwd(parser: argparse.ArgumentParser): """ Replace the default of any action that is exactly ``'current working directory'`` with the value of ``os.getcwd()``. @@ -584,9 +577,9 @@ def main(args): @classmethod def get_parser( cls, - description=None, - width=None, - formatter=argparse.ArgumentDefaultsHelpFormatter, + description: str = None, + width: int = None, + formatter: argparse.HelpFormatter = argparse.ArgumentDefaultsHelpFormatter, ): """ Construct the command-line argument parser. @@ -624,6 +617,7 @@ def get_parser( return argparse.ArgumentParser( description=description, formatter_class=lambda prog: formatter(prog, width=width), + epilog=f"LDT Observer Tools (obstools) version {__version__}", ) diff --git a/setup.cfg b/setup.cfg index 8fdd54c..4d0ed0a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,6 +20,7 @@ classifiers = Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 Programming Language :: Python :: 3.12 +# Programming Language :: Python :: 3.13 Topic :: Documentation :: Sphinx Topic :: Scientific/Engineering :: Astronomy Topic :: Software Development :: Libraries :: Python Modules @@ -35,12 +36,12 @@ include_package_data = True install_requires = setuptools setuptools_scm - astropy>=5.1 + astropy>=6.0 darkdetect ccdproc matplotlib - numpy>=1.24,<2.0.0 - scipy>=1.9 + numpy>=1.24,<2.0 + scipy PySimpleGUI-4-foss requests tqdm diff --git a/tox.ini b/tox.ini index 051002f..52acbce 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,7 @@ [tox] envlist = - {3.10,3.11,3.12}-test{,-alldeps} - {3.10,3.11,3.12}-test-numpy{124,125,126,200,201} - {3.10,3.11,3.12}-test-{numpy,astropy}dev + {3.10,3.11,3.12,3.13}-test{,-alldeps}{,-cov} + {3.10,3.11,3.12,3.13}-test-{numpy,astropy}dev codestyle requires = setuptools >= 65.0 @@ -36,22 +35,11 @@ description = devdeps: with the latest developer version of key dependencies oldestdeps: with the oldest supported version of key dependencies cov: and test coverage - numpy124: with numpy 1.24.* - numpy125: with numpy 1.25.* - numpy126: with numpy 1.26.* - numpy200: with numpy 2.0.* - numpy201: with numpy 2.1.* # The following provides some specific pinnings for key packages deps = cov: coverage - numpy124: numpy==1.24.* - numpy125: numpy==1.25.* - numpy126: numpy==1.26.* - numpy200: numpy==2.0.* - numpy201: numpy==2.1.* - numpydev: numpy>=0.0.dev0 astropydev: git+https://github.com/astropy/astropy.git#egg=astropy