convolve-rs 1.1.2

Rust port of beamcon from RACS-tools: smooth FITS images and cubes to a common beam via UV-plane (FFT) convolution
[build-system]
requires = ["maturin>=1.7,<2"]
build-backend = "maturin"

[project]
name = "convolve-rs"
requires-python = ">=3.10"
dependencies = ["numpy"]
dynamic = ["version"]
authors = [{ name = "Alec Thomson" }]
license = "BSD-3-Clause"
license-files = ["LICENSE", "NOTICE.md"]
description = "Rust port of beamcon from RACS-tools: smooth FITS images and cubes to a common beam via UV-plane (FFT) convolution"
readme = "README.md"

[project.urls]
Homepage = "https://github.com/alecthomson/convolve-rs"
Documentation = "https://convolve-rs.readthedocs.io"
Repository = "https://github.com/alecthomson/convolve-rs"

[project.optional-dependencies]
test = ["pytest", "radio-beam", "astropy"]
dev = ["prek", "ty"]
benchmark = [
    "astropy>=6.1.7",
    "ipykernel>=7.3.0",
    "matplotlib>=3.10.9",
    "nbconvert>=7.17.1",
    "nbformat>=5.10.4",
    "pandas>=2.3.3",
]

[dependency-groups]
# Docs build: `uv sync --group docs` then `uv run sphinx-build docs docs/_build`.
# A PEP 735 group (not an extra) so it never appears in the published wheel
# metadata.
docs = [
  "sphinx<9",
  "myst-nb>=1.1",            # markdown + executed notebooks (re-runs at every build)
  "furo>=2024.8.6",
  "sphinx-autoapi>=3.8.0",
  "sphinx-autodoc-typehints",
  "sphinx-copybutton",
  "sphinxcontrib-programoutput", # runs `convolvers --help` at build time (needs cargo)
  "matplotlib>=3.8",
  "astropy>=6",
]

[tool.pytest.ini_options]
# `--doctest-modules` checks the examples in the pure-Python wrapper's
# docstrings; the compiled extension's docstrings are checked by
# tests/test_doctests.py.
testpaths = ["tests", "convolve_rs"]
addopts = "--doctest-modules"

[tool.ruff]
target-version = "py310"
# The .pyi stub is generated by pyo3-stub-gen; don't lint generated output.
extend-exclude = ["convolve_rs/_convolve_rs/__init__.pyi"]

[tool.ruff.lint]
extend-select = [
  "ARG",  # flake8-unused-arguments
  "B",    # flake8-bugbear
  "BLE",  # flake8-blind-except
  "C4",   # flake8-comprehensions
  "DTZ",  # flake8-datetimez
  "EM",   # flake8-errmsg
  "EXE",  # flake8-executable
  "FA",   # flake8-future-annotations
  "FLY",  # flynt
  "FURB", # refurb
  "G",    # flake8-logging-format
  "I",    # isort
  "ICN",  # flake8-import-conventions
  "ISC",  # flake8-implicit-str-concat
  "LOG",  # flake8-logging
  "NPY",  # NumPy specific rules
  "PD",   # pandas-vet
  "PERF", # perflint
  "PGH",  # pygrep-hooks
  "PIE",  # flake8-pie
  "PL",   # pylint
  "PT",   # flake8-pytest-style
  "PTH",  # flake8-use-pathlib
  "PYI",  # flake8-pyi
  "Q",    # flake8-quotes
  "RET",  # flake8-return
  "RSE",  # flake8-raise
  "RUF",  # Ruff-specific
  "SIM",  # flake8-simplify
  "SLOT", # flake8-slots
  "T10",  # flake8-debugger
  "T20",  # flake8-print
  "TC",   # flake8-type-checking
  "TRY",  # tryceratops
  "UP",   # pyupgrade
  "YTT",  # flake8-2020
]
ignore = [
  "PLR09",   # Too many <...>
  "PLR2004", # Magic value used in comparison
  "G004",
]

[tool.ruff.lint.per-file-ignores]
# Tests deliberately assert on broad ValueError raised from the Rust layer.
"tests/**" = ["PT011"]
"scripts/**" = ["T201", ]

[tool.ty.src]
# The benchmark notebook imports a sibling script by path and leans on runtime
# invariants ty can't see; it's throwaway perf tooling, not shipped code.
exclude = ["scripts/benchmark.ipynb"]

[tool.maturin]
features = ["python"]
module-name = "convolve_rs._convolve_rs"
python-source = "."