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
106 changes: 106 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Release to PyPI

on:
push:
tags:
- 'v*' # Triggers on version tags like v3.0.0

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.13"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install dependencies
run: |
uv sync --extra dev


- name: Run tests
run: |
uv run pytest

build-and-publish:
needs: test
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write # Required for trusted publishing
contents: write # Required for creating releases

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Get full history for proper versioning

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.13"

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Build package with uv
run: |
uv build

- name: Check package
run: |
uv run twine check dist/*

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# This uses trusted publishing - no API tokens needed!

- name: Extract changelog for this version
id: changelog
run: |
# Extract the section for this version from CHANGELOG.md
VERSION=${GITHUB_REF#refs/tags/v}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT

# Extract changelog section between [VERSION] and next [VERSION] or end of file
CHANGELOG=$(awk "/^\## \[$VERSION\]/{flag=1; next} /^\## \[/{flag=0} flag" CHANGELOG.md)

# If no specific section found, use a default
if [ -z "$CHANGELOG" ]; then
CHANGELOG="See the [full changelog](https://github.com/qTipTip/SSplines/compare/v2.0.1...${GITHUB_REF_NAME}) for details."
fi

# Save changelog to output (handle multiline)
{
echo "CHANGELOG<<EOF"
echo "$CHANGELOG"
echo "EOF"
} >> $GITHUB_OUTPUT

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
generate_release_notes: true
body: |
## Changes in ${{ github.ref_name }}

${{ steps.changelog.outputs.CHANGELOG }}

---

**Installation**: `pip install SSplines==${{ steps.changelog.outputs.VERSION }}`

**Full Changelog**: https://github.com/qTipTip/SSplines/compare/v2.0.1...${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68 changes: 68 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Tests

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.13"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install dependencies
run: |
uv sync --extra dev

- name: Run tests with coverage
run: |
uv run pytest --cov=SSplines --cov-report=xml

- name: Upload coverage reports to Codecov
if: matrix.os == 'ubuntu-latest' # Only upload once
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload coverage to GitHub
if: matrix.os == 'ubuntu-latest' # Only upload once
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: htmlcov/
retention-days: 30
compression-level: 6

# This job will be required for branch protection
test-summary:
if: always()
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Check test results
run: |
if [[ "${{ needs.test.result }}" == "failure" ]]; then
echo "Tests failed!"
exit 1
elif [[ "${{ needs.test.result }}" == "cancelled" ]]; then
echo "Tests were cancelled!"
exit 1
else
echo "All tests passed!"
fi
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [3.0.0] - 2025-06-26

### Breaking Changes
- **Python 3.13+ required**: Dropped support for Python < 3.13
- Modernized build system to use pyproject.toml instead of setup.py

### Changed
- Updated numpy to modern versions (>= 1.24.0)
- Migrated from setup.py to pyproject.toml
- Added automated CI/CD pipeline with GitHub Actions

### Dependencies
- numpy >= 1.24.0
- sympy >= 1.10

## [2.0.1] - 2018-09-03

### Fixed
- Various bug fixes and improvements
- Updated documentation

### Added
- Initial implementation of S-splines on Powell-Sabin 12-split
- SplineFunction and SplineSpace objects
- Support for constant, linear, and quadratic splines
- Hermite basis conversion
- Triangle sampling methods
- Basic integration methods
62 changes: 62 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
type: software
title: "SSplines: Simplex Splines on the Powell-Sabin 12-split"
abstract: "A Python library for the evaluation of simplex splines over the Powell-Sabin 12-split of a triangle. The library provides efficient evaluation using the matrix recurrence relation for S-spline basis functions for constant, linear, and quadratic simplex splines."
authors:
- family-names: "Stangeby"
given-names: "Ivar Haugaløkken"
email: "istangeby@gmail.com"
orcid: "https://orcid.org/0000-0002-7697-7526"
version: "2.0.1"
date-released: "2024-12-20"
license: MIT
repository-code: "https://github.com/qTipTip/SSplines"
url: "https://github.com/qTipTip/SSplines"
doi: "10.5281/zenodo.15742326"
keywords:
- "splines"
- "finite element method"
- "Powell-Sabin"
- "simplex splines"
- "numerical analysis"
- "computational geometry"
- "interpolation"
- "multivariate splines"

# Preferred citation for the software
preferred-citation:
type: thesis
title: "Simplex Splines on the Powell-Sabin 12-Split"
authors:
- family-names: "Stangeby"
given-names: "Ivar Haugaløkken"
thesis-type: "Master thesis"
institution:
name: "University of Oslo"
year: 2018
url: "http://hdl.handle.net/10852/64070"
identifiers:
- type: "other"
value: "URN:NBN:no-66606"
description: "URN"

# Related references
references:
- type: article
title: "S-splines"
authors:
- family-names: "Cohen"
given-names: "Elaine"
- family-names: "Lyche"
given-names: "Tom"
- family-names: "Riesenfeld"
given-names: "Richard"
journal: "Mathematics of Computation"
volume: 82
issue: 283
start: 1577
end: 1596
year: 2013
doi: "10.1090/S0025-5718-2013-02664-6"
scope: "Theoretical foundation for the S-splines implementation"
Loading
Loading