Added sp-repo-review to pre-commit by astrofrog · Pull Request #411 · astropy/reproject · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions .github/dependabot.yml
11 changes: 4 additions & 7 deletions .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: CI
on:
push:
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -14,20 +15,16 @@ jobs:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
envs: |
- macos: py38-test-oldestdeps
- macos: py39-test
- macos: py39-test-oldestdeps
- macos: py310-test
- macos: py311-test
- macos: py312-test
- linux: py38-test-oldestdeps
- linux: py38-test
- linux: py39-test
- linux: py39-test-oldestdeps
- linux: py310-test
- linux: py311-test
- linux: py312-test
- linux: py312-test-devdeps
- windows: py38-test-oldestdeps
- windows: py39-test
- windows: py39-test-oldestdeps
- windows: py310-test
- windows: py311-test
- windows: py312-test
Expand Down
36 changes: 20 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,6 @@ repos:
- id: trailing-whitespace
exclude: ".*(data.*|extern.*|licenses.*|.*.fits)$"

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
args:
- "--filter-files"

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: ["--py38-plus"]
exclude: ".*(extern.*|_parsetab.py|_lextab.py)$"

# We list the warnings/errors to check for here rather than in setup.cfg because
# we don't want these options to apply whenever anyone calls flake8 from the
# command-line or their code editor - in this case all warnings/errors should be
Expand Down Expand Up @@ -66,7 +51,7 @@ repos:
]
exclude: ".*(data.*|extern.*|cextern)$"

- repo: https://github.com/psf/black
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.11.0
hooks:
- id: black
Expand All @@ -78,5 +63,24 @@ repos:
files: ".*(high_level|mosaicking).*$"
exclude: ".*(tests.*)$"

- repo: https://github.com/scientific-python/cookie
rev: 2023.11.17
hooks:
- id: sp-repo-review

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
args: ["--write-changes"]
additional_dependencies:
- tomli

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.5"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]

ci:
autofix_prs: false
2 changes: 1 addition & 1 deletion RELEASE_INSTRUCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Making a New Reproject Release
==============================

A new release of reproject is almost fully automated.
As a mantainer it should be nice and simple to do, especially if all merged PRs
As a maintainer it should be nice and simple to do, especially if all merged PRs
have nice titles and are correctly labelled.

Here is the process to follow to make a new release:
Expand Down
4 changes: 2 additions & 2 deletions docs/celestial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Currently, this package implements :ref:`interpolation<interpolation>`,

However, the :ref:`adaptive resampling<adaptive>` algorithm provides
an option to conserve flux by appropriately rescaling each output
pixel. With this option, an image in flux units need not be coverted
pixel. With this option, an image in flux units need not be converted
to surface brightness.

.. _common:
Expand Down Expand Up @@ -448,7 +448,7 @@ Multiple images with the same coordinates
If you have multiple images with the exact same coordinate system (e.g. a raw
image and a corresponding processed image) and want to reproject both to the
same output frame, it is faster to compute the coordinate mapping between input
and output pixels only once and re-use this mapping for each reprojection. This
and output pixels only once and reuse this mapping for each reprojection. This
is supported by passing multiple input images as an additional dimension in the
input data array. When the input array contains more dimensions than the input
WCS describes, the extra leading dimensions are taken to represent separate
Expand Down
67 changes: 10 additions & 57 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,48 +1,15 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
#
# Astropy documentation build configuration file.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this file.
#
# All configuration values have a default. Some values are defined in
# the global Astropy configuration which is loaded here before anything else.
# See astropy.sphinx.conf for which values are set there.

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('..'))
# IMPORTANT: the above commented section was generated by sphinx-quickstart, but
# is *NOT* appropriate for astropy or Astropy affiliated packages. It is left
# commented out with this explanation to make it clear why this should not be
# done. If the sys.path entry above is added, when the astropy.sphinx.conf
# import occurs, it will import the *source* version of astropy instead of the
# version installed (if invoked as "make html" or directly with sphinx), or the
# version in the build directory (if "python setup.py build_sphinx" is used).
# Thus, any C-extensions that are needed to build the documentation will *not*
# be accessible, and the documentation will not build correctly.

import os
import sys

import datetime
from importlib import import_module
import sys
from importlib import metadata

try:
from sphinx_astropy.conf.v1 import * # noqa
except ImportError:
print("ERROR: the documentation requires the sphinx-astropy package to be installed")
sys.exit(1)

# Get configuration information from setup.cfg
from configparser import ConfigParser

conf = ConfigParser()

conf.read([os.path.join(os.path.dirname(__file__), "..", "setup.cfg")])
setup_cfg = dict(conf.items("metadata"))

# -- General configuration ----------------------------------------------------

# By default, highlight as Python 3.
Expand All @@ -62,22 +29,21 @@

# -- Project information ------------------------------------------------------

package_info = metadata.metadata("reproject")

# This does not *have* to match the package name, but typically does
project = setup_cfg["name"]
author = setup_cfg["author"]
copyright = "{}, {}".format(datetime.datetime.now().year, setup_cfg["author"])
project = package_info["Name"]
author = package_info["Author"]
copyright = "{}, {}".format(datetime.datetime.now().year, package_info["Author"])

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.

import_module(setup_cfg["name"])
package = sys.modules[setup_cfg["name"]]

# The short X.Y version.
version = package.__version__.split("-", 1)[0]
version = package_info["Version"].split("-", 1)[0]
# The full version, including alpha/beta/rc tags.
release = package.__version__
release = package_info["Version"]


# -- Options for HTML output ---------------------------------------------------
Expand Down Expand Up @@ -140,19 +106,6 @@

## -- Options for the edit_on_github extension ----------------------------------------

if eval(setup_cfg.get("edit_on_github")):
extensions += ["astropy_helpers.sphinx.ext.edit_on_github"]

versionmod = __import__(setup_cfg["package_name"] + ".version")
edit_on_github_project = setup_cfg["github_project"]
if versionmod.version.release:
edit_on_github_branch = "v" + versionmod.version.version
else:
edit_on_github_branch = "main"

edit_on_github_source_root = ""
edit_on_github_doc_root = "docs"

nitpicky = True

plot_rcparams = {}
Expand Down
2 changes: 1 addition & 1 deletion docs/dask.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ processes to use.
Output dask arrays
------------------

By default, the reprojection functions will do the computation immmediately and
By default, the reprojection functions will do the computation immediately and
return Numpy arrays for the reprojected array and optionally the footprint (this
is regardless of whether dask or Numpy arrays were passed in, or any of the
parallelization options above). However, by setting ``return_type='dask'``, you
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Requirements

This package has the following hard run time dependencies:

* `Python <http://www.python.org/>`__ 3.8 or later
* `Python <http://www.python.org/>`__ 3.9 or later

* `Numpy <http://www.numpy.org/>`__ 1.20 or later

Expand Down
2 changes: 1 addition & 1 deletion docs/mosaicking.rst
Loading