Skip to content

Commit

Permalink
Merge pull request #73 from weaverba137/remove-2d-bspline
Browse files Browse the repository at this point in the history
Add notes about 2D bspline support
  • Loading branch information
weaverba137 committed Dec 19, 2023
2 parents 53ec40a + c7f8984 commit d61092e
Show file tree
Hide file tree
Showing 40 changed files with 822 additions and 664 deletions.
67 changes: 50 additions & 17 deletions .github/workflows/ci_cron_weekly.yml
@@ -1,27 +1,60 @@
# GitHub Actions workflow that runs on a cron schedule.

name: Cron Scheduled CI Tests
name: Weekly cron

on:
pull_request:
# We also want this workflow triggered if the 'Extra CI' label is added
# or present when PR is updated
types:
- synchronize
- labeled
schedule:
# run at 6am UTC on Mondays
# run every Monday at 6am UTC
- cron: '0 6 * * 1'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# Testing links in documents is a good example of something to run on a schedule
# to catch links that stop working for some reason.
doc_test:
runs-on: ubuntu-latest
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
if: (github.repository == 'astropy/specutils' && (github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'Extra CI')))
strategy:
fail-fast: false
matrix:
include:

# We do not use remote data here, since
# that gives too many false positives due to URL timeouts.
- name: Python 3.11 with pre-release version of key dependencies
os: ubuntu-latest
python: '3.11'
toxenv: py311-test-predeps

- name: Documentation link check
os: ubuntu-latest
python: '3.10'
toxenv: linkcheck

steps:
- uses: actions/checkout@v3
- name: Set up Python to build docs with sphinx
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Check links in docs using tox
python-version: ${{ matrix.python }}
- name: Install language-pack-de and tzdata
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
tox -e linkcheck
sudo apt-get update
sudo apt-get install language-pack-de tzdata
- name: Install graphviz
if: ${{ matrix.toxenv == 'linkcheck' }}
run: sudo apt-get install graphviz
- name: Install Python dependencies
run: python -m pip install --upgrade tox
- name: Run tests
run: tox ${{ matrix.toxargs}} -e ${{ matrix.toxenv}} -- ${{ matrix.toxposargs}}
86 changes: 0 additions & 86 deletions .github/workflows/ci_tests.yml

This file was deleted.

126 changes: 126 additions & 0 deletions .github/workflows/ci_workflows.yml
@@ -0,0 +1,126 @@
name: CI

on:
push:
pull_request:
schedule:
# run every Wednesday at 5pm UTC
- cron: '17 0 * * 3'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:

- name: Code style checks
os: ubuntu-latest
python: 3.x
toxenv: codestyle

- name: Documentation build check
os: ubuntu-latest
python: 3.x
toxenv: build_docs

- name: Python 3.11 with astropy data and coverage
os: ubuntu-latest
python: '3.11'
toxenv: py311-test-cov
toxargs: -v
toxposargs: --remote-data=astropy

- name: Python 3.11 (Windows)
os: windows-latest
python: 3.11
toxenv: py311-test

- name: Python 3.11 (MacOS X)
os: macos-latest
python: 3.11
toxenv: py311-test

- name: Python 3.10
os: ubuntu-latest
python: '3.10'
toxenv: py310-test

- name: Python 3.9
os: ubuntu-latest
python: 3.9
toxenv: py39-test

- name: Python 3.8 with oldest supported version of key dependencies
os: ubuntu-20.04
python: 3.8
toxenv: py38-test-oldestdeps

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install language-pack-de and tzdata
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install language-pack-de tzdata graphviz
- name: Install Python dependencies
run: python -m pip install --upgrade tox codecov
- name: Run tests
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}

allowed_failures:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: (Allowed Failure) Python 3.11 with development versions of key dependencies
os: ubuntu-latest
python: '3.11'
toxenv: py311-test-devdeps
toxargs: -v

- name: (Allowed Failure) Python 3.12 with remote data and dev version of key dependencies
os: ubuntu-latest
python: '3.12-dev'
toxenv: py312-test-devdeps
toxargs: -v
toxposargs: --remote-data=any

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install language-pack-de and tzdata
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install language-pack-de tzdata
- name: Install Python dependencies
run: python -m pip install --upgrade tox codecov
- name: Run tests
# This is the specific switch for allowed failures.
continue-on-error: true
run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}
22 changes: 22 additions & 0 deletions conftest.py
@@ -0,0 +1,22 @@
try:
from pytest_astropy_header.display import PYTEST_HEADER_MODULES, TESTED_VERSIONS
ASTROPY_HEADER = True
except ImportError:
ASTROPY_HEADER = False


# Repeat this from specutils/conftest.py so tox picks it up.
def pytest_configure(config):

if ASTROPY_HEADER:
config.option.astropy_header = True

# Customize the following lines to add/remove entries from the list of
# packages for which version numbers are displayed when running the tests.
PYTEST_HEADER_MODULES.pop('Pandas', None)
PYTEST_HEADER_MODULES.pop('h5py', None)
PYTEST_HEADER_MODULES['Astropy'] = 'astropy'
PYTEST_HEADER_MODULES['PyDL'] = 'pydl'

from pydl import __version__
TESTED_VERSIONS['pydl'] = __version__
9 changes: 8 additions & 1 deletion docs/changes.rst
Expand Up @@ -5,12 +5,19 @@ PyDL Changelog
1.0.0 (unreleased)
------------------

* Deprecate support for 2-dimensional B-spline, which is better supported in
other packages such as PypeIt_ or specreduce_ (PR `#73`_).
* Use specutils_ as an informal template for Python packaging boilerplate (PR `#73`_).
* Change Harris Geospatial to NV5 Geospatial.
* Update testing infrastructure (PR `#67`_).
* Update links to documentation (PR `#64`_).
* Change Harris Geospatial to NV5 Geospatial.

.. _`#64`: https://github.com/weaverba137/pydl/pull/64
.. _`#67`: https://github.com/weaverba137/pydl/pull/67
.. _`#73`: https://github.com/weaverba137/pydl/pull/73
.. _PypeIt: https://pypeit.readthedocs.io/en/release/index.html
.. _specreduce: https://specreduce.readthedocs.io/en/latest/
.. _specutils: https://specutils.readthedocs.io/en/latest/

1.0.0rc2 (2021-07-22)
---------------------
Expand Down
38 changes: 14 additions & 24 deletions pydl/__init__.py
Expand Up @@ -12,25 +12,13 @@
.. _`IDL®`: https://www.nv5geospatialsoftware.com/Products/IDL
"""
import os
from astropy.tests.runner import TestRunner

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

# Enforce Python version check during package import.
# This is the same check as the one at the top of setup.py
import sys

__minimum_python_version__ = "3.5"

class UnsupportedPythonError(Exception):
pass

if sys.version_info < tuple((int(val) for val in __minimum_python_version__.split('.'))):
raise UnsupportedPythonError("packagename does not support Python < {}".format(__minimum_python_version__))

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

from .file_lines import file_lines
from .median import median
Expand All @@ -40,18 +28,20 @@ class UnsupportedPythonError(Exception):
from .uniq import uniq


# Workaround: Numpy 1.14.x changes the way arrays are printed.
# try:
# from numpy import set_printoptions
# set_printoptions(legacy='1.13')
# except Exception:
# pass
# Create the test function for self test
test = TestRunner.make_test_runner_in(os.path.dirname(__file__))
test.__test__ = False


class PydlException(Exception):
"""Base class for exceptions raised in PyDL functions.
"""
pass


__all__ = ['file_lines', 'median', 'pcomp', 'rebin', 'smooth', 'uniq',
'PydlException']

# Clean up namespace
del os
del TestRunner

0 comments on commit d61092e

Please sign in to comment.