Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implementation of line matching #182

Merged
merged 43 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
c7c11d5
rename and move function to return available line catalogs.
tepickering Apr 12, 2023
eb002d4
tweak docstring; add initial sketch for LineMatch classes
tepickering Apr 13, 2023
9130a1b
dev notebook work; more line_matching sketch-up
tepickering Apr 14, 2023
2f3714d
add ruff config to pyproject for faster linting
tepickering May 11, 2023
d035f85
remove check for astropy < 3.x
tepickering May 11, 2023
7f7e350
add missing function to __all__ in synth_data.py
tepickering May 11, 2023
dc641db
Merge remote-tracking branch 'upstream/main' into line_matching
tepickering May 18, 2023
a63aa45
make the spatial profile for a traced source a passed argument vs har…
tepickering May 18, 2023
aad31d4
codestyle cleanups
tepickering May 18, 2023
026a600
flesh out type annotations in synth_data and edit docstrings to refle…
tepickering May 19, 2023
608e111
notebook edits
tepickering May 20, 2023
3ad3b4f
comment out undefined method for now
tepickering May 20, 2023
60b624c
change relative to absolute imports
tepickering May 20, 2023
6f1a7aa
remove astropy_helpers vestige; packaging cleanups; set python_requir…
tepickering May 20, 2023
f6e50d0
update tox.ini to reflect new python_requires
tepickering May 20, 2023
4f4d660
update CI workflows
tepickering May 20, 2023
96c52ad
flesh out more type annotations
tepickering May 25, 2023
cd9717d
add support for comma-separated strings to build line catalogs
tepickering May 25, 2023
ef57d34
update dev notebook to reflect some api changes in linelists
tepickering Jun 6, 2023
be406a7
flesh out match_lines_wcs; save notebook dev
tepickering Jun 16, 2023
d61cd63
actually commit dev notebook
tepickering Jun 16, 2023
6b4f9f6
loosen typing on match_lines_wcs, but add sanity checking by casting …
tepickering Jun 18, 2023
9d27c7e
add routine to find arc lines and centroid them
tepickering Jun 18, 2023
8eeb8e0
fix units in match_lines_wcs
tepickering Jun 18, 2023
f68267e
allow fwhm to be a float and assume u.pix if so
tepickering Jun 19, 2023
79e31ea
fix line matching tests to ignore warnings and mark use of remote data
tepickering Jun 19, 2023
6b6f75a
add wavecal_demo notebook
tepickering Jun 20, 2023
7f7a192
Merge remote-tracking branch 'upstream/main' into line_matching
tepickering Jun 21, 2023
c098278
fix some post-merge issues
tepickering Jun 21, 2023
4bd0652
fix column name to match
tepickering Jun 21, 2023
1e4577c
demo notebook updates; codestyle fixes
tepickering Jun 21, 2023
10ef0a1
remove old numpy versions from tox.ini that aren't python 3.10 compat…
tepickering Jun 21, 2023
3a1d1ac
tweak up min tested scipy version
tepickering Jun 21, 2023
298a4fe
ignore new datetime warnings in python 3.12
tepickering Nov 1, 2023
553d6f2
Merge branch 'main' into line_matching
tepickering Nov 1, 2023
8c8123d
remove crutches for py312; don't seem to be needed anymore
tepickering Nov 1, 2023
e310f07
fix typo; clarify docstring; simplify check
tepickering Nov 3, 2023
1436ce0
resolve the myriad conflicts encountered when merging #202
tepickering Dec 15, 2023
c6a8bc8
codestyle fix
tepickering Dec 15, 2023
8994bb9
code now is using features that require python >= 3.10
tepickering Dec 15, 2023
f226188
add warning to line_matching.py if the matched set is empty
tepickering May 17, 2024
1ed3c2c
fix codestyle bug; remove mark from fixture in test_line_matching
tepickering May 17, 2024
1845c6f
fix name in workflow
tepickering May 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/cron-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ jobs:
# For example -- os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
python: '3.10'
python: '3.11'
tox_env: 'linkcheck'
- os: ubuntu-latest
python: '3.10'
python: '3.11'
tox_env: 'py310-test-datadeps-devdeps'
- os: ubuntu-latest
python: '3.10'
python: '3.11'
tox_env: 'py310-test-datadeps-predeps'

steps:
Expand All @@ -40,7 +40,7 @@ jobs:
with:
fetch-depth: 0
- name: Set up python ${{ matrix.python }} with tox environment ${{ matrix.tox_env }} on ${{ matrix.os }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install base dependencies
Expand Down
23 changes: 10 additions & 13 deletions .github/workflows/tox-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,35 +31,32 @@ jobs:
# Only run on ubuntu by default, but can add other os's to the test matrix here.
# For example -- os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
python: '3.8'
tox_env: 'py38-test'
- os: ubuntu-latest
python: '3.9'
tox_env: 'py39-test'
- os: ubuntu-latest
python: '3.10'
tox_env: 'py310-test-cov'
tox_env: 'py310-test'
- os: ubuntu-latest
python: '3.11'
tox_env: 'py311-test-cov'
- os: macos-latest
python: '3.10'
tox_env: 'py310-test-devdeps'
python: '3.11'
tox_env: 'py311-test-devdeps'
- os: ubuntu-latest
python: '3.11'
tox_env: 'py311-test'
- os: ubuntu-latest
python: '3.10'
python: '3.11'
tox_env: 'codestyle'
- os: ubuntu-latest
python: '3.8'
tox_env: 'py38-test-oldestdeps'
python: '3.10'
tox_env: 'py310-test-oldestdeps'

steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up python ${{ matrix.python }} with tox environment ${{ matrix.tox_env }} on ${{ matrix.os }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install base dependencies
Expand Down
595 changes: 517 additions & 78 deletions notebook_sandbox/dev.ipynb

Large diffs are not rendered by default.

386 changes: 386 additions & 0 deletions notebook_sandbox/wavecal_demo.ipynb

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[tool.ruff]
line-length = 100

[build-system]

requires = ["setuptools",
Expand Down
5 changes: 1 addition & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ github_project = astropy/specreduce
[options]
zip_safe = False
packages = find:
python_requires = >=3.8
python_requires = >=3.10
setup_requires = setuptools_scm
install_requires =
astropy
Expand Down Expand Up @@ -70,19 +70,16 @@ text_file_format = rst
addopts = --doctest-rst
filterwarnings =
error
ignore:Can\'t import specreduce_data package:
ignore:numpy.ndarray size changed:

[coverage:run]
omit =
specreduce/_astropy_init*
specreduce/conftest.py
specreduce/*setup_package*
specreduce/tests/*
specreduce/*/tests/*
specreduce/extern/*
specreduce/version*
*/specreduce/_astropy_init*
*/specreduce/conftest.py
*/specreduce/*setup_package*
*/specreduce/tests/*
Expand Down
22 changes: 17 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@

from setuptools import setup

from extension_helpers import get_extensions


# First provide helpful messages if contributors try and run legacy commands
# for tests or docs.

Expand Down Expand Up @@ -65,5 +62,20 @@
print(DOCS_HELP)
sys.exit(1)

setup(use_scm_version={'write_to': os.path.join('specreduce', 'version.py')},
ext_modules=get_extensions())
VERSION_TEMPLATE = """
# Note that we need to fall back to the hard-coded version if either
# setuptools_scm can't be imported or setuptools_scm can't determine the
# version, so we catch the generic 'Exception'.
try:
from setuptools_scm import get_version
version = get_version(root='..', relative_to=__file__)
except Exception:
version = '{version}'
""".lstrip()

setup(
use_scm_version={
'write_to': os.path.join('specreduce', 'version.py'),
'write_to_template': VERSION_TEMPLATE
}
)
12 changes: 6 additions & 6 deletions specreduce/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst

# Packages may add whatever they like to this file, but
# should keep this content at the top.
# ----------------------------------------------------------------------------
from ._astropy_init import * # noqa
# ----------------------------------------------------------------------------

from specreduce.core import * # noqa
from specreduce.wavelength_calibration import * # noqa

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this necessary? specreduce.__version__ seems to be correct already

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it may not be. i just moved it over from _astropy_init.py as-is so there'd be no surprises. kind of a vestige of the old astropy-helpers, but other coordinated packages like photutils have this in their __init__.py as well, fwiw.


try:
from .version import version as __version__
except ImportError:
__version__ = ''

Check warning on line 10 in specreduce/__init__.py

View check run for this annotation

Codecov / codecov/patch

specreduce/__init__.py#L9-L10

Added lines #L9 - L10 were not covered by tests
14 changes: 0 additions & 14 deletions specreduce/_astropy_init.py

This file was deleted.