Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: v2.0.5
_commit: v2.1.1
_src_path: gh:lincc-frameworks/python-project-template
author_email: mtauraso@uw.edu
author_name: LINCC Frameworks
Expand All @@ -18,7 +18,8 @@ project_license: MIT
project_name: hyrax
project_organization: lincc-frameworks
python_versions:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'
test_lowest_version: none
6 changes: 5 additions & 1 deletion .github/ISSUE_TEMPLATE/1-bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ assignees: ''
**Bug report**


**Environment Information**


**Before submitting**
Please check the following:

- [ ] I have described the situation in which the bug arose, including what code was executed, information about my environment, and any applicable data others will need to reproduce the problem.
- [ ] I have described the situation in which the bug arose, including what code was executed, and any applicable data others will need to reproduce the problem.
- [ ] I have included information about my environment, including the version of this package (e.g. `hyrax.__version__`)
- [ ] I have included available evidence of the unexpected behavior (including error messages, screenshots, and/or plots) as well as a description of what I expected instead.
- [ ] If I have a solution in mind, I have provided an explanation and/or pseudocode and/or task list.
6 changes: 3 additions & 3 deletions .github/workflows/asv-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
branches: [ main ]

env:
PYTHON_VERSION: "3.10"
ASV_VERSION: "0.6.4"
PYTHON_VERSION: "3.11"
ASV_VERSION: "0.6.5"
WORKING_DIR: ${{github.workspace}}/benchmarks

concurrency:
Expand All @@ -34,7 +34,7 @@ jobs:
with:
fetch-depth: 0
- name: Install dependencies
run: pip install "asv[virtualenv]==${{env.ASV_VERSION}}"
run: pip install asv[virtualenv]==${{env.ASV_VERSION}}
- name: Configure git
run: |
git config user.name "github-actions[bot]"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/asv-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:
workflow_dispatch:

env:
PYTHON_VERSION: "3.10"
ASV_VERSION: "0.6.4"
PYTHON_VERSION: "3.11"
ASV_VERSION: "0.6.5"
WORKING_DIR: ${{github.workspace}}/benchmarks
NIGHTLY_HASH_FILE: nightly-hash

Expand All @@ -30,7 +30,7 @@ jobs:
with:
fetch-depth: 0
- name: Install dependencies
run: pip install "asv[virtualenv]==${{env.ASV_VERSION}}"
run: pip install asv[virtualenv]==${{env.ASV_VERSION}}
- name: Configure git
run: |
git config user.name "github-actions[bot]"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/asv-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ concurrency:
cancel-in-progress: true

env:
PYTHON_VERSION: "3.10"
ASV_VERSION: "0.6.4"
PYTHON_VERSION: "3.11"
ASV_VERSION: "0.6.5"
WORKING_DIR: ${{github.workspace}}/benchmarks
ARTIFACTS_DIR: ${{github.workspace}}/artifacts

Expand All @@ -39,7 +39,7 @@ jobs:
run: |
echo "Workflow Run ID: ${{github.run_id}}"
- name: Install dependencies
run: pip install "asv[virtualenv]==${{env.ASV_VERSION}}" lf-asv-formatter
run: pip install asv[virtualenv]==${{env.ASV_VERSION}} lf-asv-formatter
- name: Make artifacts directory
run: mkdir -p ${{env.ARTIFACTS_DIR}}
- name: Save pull request number
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:

steps:
- uses: actions/checkout@v6
- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: '3.10'
python-version: '3.11'
- name: Install dependencies
run: |
sudo apt-get update
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/pre-commit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.10'
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: |
sudo apt-get update
python -m pip install --upgrade pip
pip install .[dev]
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
uv pip install --system .[dev]
if [ -f requirements.txt ]; then uv pip install --system -r requirements.txt; fi
- uses: pre-commit/action@v3.0.1
with:
extra_args: --all-files --verbose
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.10'
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,21 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
python-version: ['3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: |
sudo apt-get update
python -m pip install --upgrade pip
pip install -e .[dev]
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
uv pip install --system -e .[dev]
if [ -f requirements.txt ]; then uv pip install --system -r requirements.txt; fi
- name: List dependencies
run: |
pip list
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/testing-and-coverage.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# This workflow will install Python dependencies, run tests and report code coverage with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

Expand All @@ -15,24 +16,25 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
python-version: ['3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: |
sudo apt-get update
python -m pip install --upgrade pip
pip install -e .[dev]
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
uv pip install --system -e .[dev]
if [ -f requirements.txt ]; then uv pip install --system -r requirements.txt; fi
- name: Run unit tests with pytest
run: |
python -m pytest --cov=hyrax --cov-report=xml -m "not slow"
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ repos:
args: ['--maxkb=500']
# Verify that pyproject.toml is well formed
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.12.1
rev: v0.24.1
hooks:
- id: validate-pyproject
name: Validate pyproject.toml
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
13 changes: 11 additions & 2 deletions .setup_dev.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
#!/usr/bin/env bash

# Bash Unofficial strict mode (http://redsymbol.net/articles/unofficial-bash-strict-mode/)
# and (https://disconnected.systems/blog/another-bash-strict-mode/)
set -o nounset # Any uninitialized variable is an error
set -o errexit # Exit the script on the failure of any command to execute without error
set -o pipefail # Fail command pipelines on the failure of any individual step
IFS=$'\n\t' #set internal field separator to avoid iteration errors
# Trap all exits and output something helpful
trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR

# This script should be run by new developers to install this package in
# editable mode and configure their local environment

echo "Checking virtual environment"
if [ -z "${VIRTUAL_ENV}" ] && [ -z "${CONDA_PREFIX}" ]; then
if [ "${VIRTUAL_ENV:-missing}" = "missing" ] && [ "${CONDA_PREFIX:-missing}" = "missing" ]; then
echo 'No virtual environment detected: none of $VIRTUAL_ENV or $CONDA_PREFIX is set.'
echo
echo "=== This script is going to install the project in the system python environment ==="
Expand All @@ -20,7 +29,7 @@ fi

echo "Checking pip version"
MINIMUM_PIP_VERSION=22
pipversion=( $(python -m pip --version | awk '{print $2}' | sed 's/\./ /g') )
pipversion=( $(python -m pip --version | awk '{print $2}' | sed 's/\./\n\t/g') )
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

The version parsing on this line is broken due to the IFS change on line 8. The new strict mode sets IFS=$'\n\t' (newline and tab only), which means array splitting won't happen on spaces anymore. The sed replacement pattern 's/\./\n\t/g' attempts to replace dots with newline+tab, but:

  1. In sed's replacement string, \n is not universally supported (it's GNU sed specific and version-dependent). It may produce literal characters instead of actual newlines.
  2. Even if it works, the mixed newline+tab delimiter is unusual and fragile.

The original code used 's/\./ /g' to replace dots with spaces and relied on the default IFS (which includes spaces) for array splitting. To fix this, either:

  • Temporarily reset IFS before the array assignment: IFS=' ' pipversion=( ... )
  • Or use a different approach that works with the new IFS, such as: IFS=$'\n' pipversion=( $(python -m pip --version | awk '{print $2}' | sed 's/\./\n/g') )
Suggested change
pipversion=( $(python -m pip --version | awk '{print $2}' | sed 's/\./\n\t/g') )
IFS='.' read -ra pipversion <<< "$(python -m pip --version | awk '{print $2}')"

Copilot uses AI. Check for mistakes.
if let "${pipversion[0]}<${MINIMUM_PIP_VERSION}"; then
echo "Insufficient version of pip found. Requires at least version ${MINIMUM_PIP_VERSION}."
echo "See https://lincc-ppt.readthedocs.io/ for details."
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 LINCC Frameworks
Copyright (c) 2025 LINCC Frameworks

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
// The Pythons you'd like to test against. If not provided, defaults
// to the current version of Python used to run `asv`.
"pythons": [
"3.10"
"3.11"
],
// The matrix of dependencies to test. Each key is the name of a
// package (in PyPI) and the values are version numbers. An empty
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "hyrax"
copyright = "2024, LINCC Frameworks"
copyright = "2025, LINCC Frameworks"
author = "LINCC Frameworks"
release = version("hyrax")
# for example take major/minor
Expand Down
21 changes: 6 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[project]
name = "hyrax"
license = {file = "LICENSE"}
license = "MIT"
license-files = ["LICENSE"]
readme = "README.md"
authors = [
{ name = "LINCC Frameworks", email = "mtauraso@uw.edu" }
]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python",
]
dynamic = ["version"]
requires-python = ">=3.9"
requires-python = ">=3.10"
dependencies = [
"astropy", # Used to load fits files of sources to query HSC cutout server
# Pin to the current version of pytorch ignite so workarounds to
Expand Down Expand Up @@ -65,7 +65,7 @@ examples = [
]

dev = [
"asv==0.6.5", # Used to compute performance benchmarks
"asv[virtualenv]==0.6.5", # Used to compute performance benchmarks
"jupyter", # Clears output from Jupyter notebooks
"matplotlib", # For example notebooks
"pre-commit", # Used to run checks before finalizing a git commit
Expand Down Expand Up @@ -107,18 +107,9 @@ markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
]

[tool.black]
line-length = 110
target-version = ["py39"]

[tool.isort]
profile = "black"
line_length = 110

[tool.ruff]
line-length = 110
target-version = "py39"

target-version = "py310"
[tool.ruff.lint]
select = [
# pycodestyle
Expand Down Expand Up @@ -150,7 +141,6 @@ select = [
# Numpy v2.0 compatibility
"NPY201",
]

ignore = [
"UP006", # Allow non standard library generics in type hints
"UP007", # Allow Union in type hints
Expand All @@ -161,5 +151,6 @@ ignore = [
"UP028", # Allow yield in for loop
]


[tool.coverage.run]
omit=["src/hyrax/_version.py"]
6 changes: 6 additions & 0 deletions tests/hyrax/test_packaging.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import hyrax


def test_version():
"""Check to see that we can get the package version"""
assert hyrax.__version__ is not None
Loading