Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
@@ -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 }}
Expand Down Expand Up @@ -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:
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Docs
on:
push: null
pull_request:
types:
- opened
workflow_dispatch: null
push:
workflow_dispatch:

permissions:
contents: write
Expand Down
25 changes: 25 additions & 0 deletions doc/deveny_ql.rst
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 2 additions & 0 deletions doc/help/deveny_collfocus.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@

options:
-h, --help show this help message and exit

LDT Observer Tools (obstools) version 0.6.7

2 changes: 2 additions & 0 deletions doc/help/deveny_grangle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 changes: 2 additions & 0 deletions doc/help/dfocus.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 changes: 2 additions & 0 deletions doc/help/fix_ldt_header.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@

options:
-h, --help show this help message and exit

LDT Observer Tools (obstools) version 0.6.7

2 changes: 2 additions & 0 deletions doc/help/lmi_etc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@

options:
-h, --help show this help message and exit

LDT Observer Tools (obstools) version 0.6.7

2 changes: 2 additions & 0 deletions doc/help/neocp_ephem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@

options:
-h, --help show this help message and exit

LDT Observer Tools (obstools) version 0.6.7

2 changes: 2 additions & 0 deletions doc/help/scrub_deveny_pickup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 changes: 1 addition & 1 deletion doc/include/dependencies_table.rst
Original file line number Diff line number Diff line change
@@ -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``
================================ =================================================================================================================================================================================================================================
2 changes: 2 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Dependencies Table
:hidden:

Exposure Time Calculator <lmi_etc>
LMI Quick Look Tool <lmi_ql>

.. toctree::
:caption: DeVeny Tools
Expand All @@ -32,6 +33,7 @@ Dependencies Table
Collimator Focus Sequence Estimator <deveny_collfocus>
Collimator Focus Calculator <dfocus>
Pickup Noise Scrubber <scrub_deveny_pickup>
DeVeny Spectrum Quick Look Tool <deveny_ql>

.. toctree::
:caption: General LDT Tools
Expand Down
27 changes: 27 additions & 0 deletions doc/lmi_ql.rst
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 2 additions & 0 deletions doc/scripts/write_script_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Empty file added obstools/tests/files/.gitkeep
Empty file.
20 changes: 7 additions & 13 deletions obstools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()``.
Expand All @@ -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.
Expand Down Expand Up @@ -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__}",
)


Expand Down
7 changes: 4 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
16 changes: 2 additions & 14 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand Down