Skip to content
Open
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
12 changes: 12 additions & 0 deletions .github/TEST_FAIL_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: "{{ env.TITLE }}"
labels: [bug]
---
The {{ workflow }} workflow failed on {{ date | date("YYYY-MM-DD HH:mm") }} UTC

The most recent failing test was on {{ env.PLATFORM }} py{{ env.PYTHON }}
with commit: {{ sha }}

Full run: https://github.com/{{ repo }}/actions/runs/{{ env.RUN_ID }}

(This post will be updated if another test fails, as long as this issue remains open.)
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "ci(dependabot):"
95 changes: 58 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,77 +2,98 @@ name: CI

on:
push:
branches:
- main
tags:
- "v*"
pull_request: {}
branches: [main]
tags: [v*]
pull_request:
workflow_dispatch:
schedule:
# run every week (for --pre release tests)
- cron: "0 0 * * 0"

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

jobs:
check-manifest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx run check-manifest

test:
name: ${{ matrix.platform }} (${{ matrix.python-version }})
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, '3.10']
platform: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
platform: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up miniconda ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
mamba-version: "*"
channels: conda-forge
channel-priority: true
cache-dependency-path: "pyproject.toml"
cache: "pip"

- name: Install dependencies
shell: bash -l {0}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
mamba install pyopencl ocl-icd-system pocl scipy numpy
pip install -e .[testing]
python -m pip install -U pip
# if running a cron job, we add the --pre flag to test against pre-releases
python -m pip install .[test] ${{ github.event_name == 'schedule' && '--pre' || '' }}

- name: 🧪 Run Tests
run: pytest --color=yes --cov --cov-report=xml --cov-report=term-missing

- name: Test
shell: bash -l {0}
run: pytest -v --color yes
- name: 📝 Report --pre Failures
if: failure() && github.event_name == 'schedule'
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLATFORM: ${{ matrix.platform }}
PYTHON: ${{ matrix.python-version }}
RUN_ID: ${{ github.run_id }}
TITLE: "[test-bot] pip install --pre is failing"
with:
filename: .github/TEST_FAIL_TEMPLATE.md
update_existing: true

- name: Coverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3

deploy:
name: Deploy
needs: test
if: "success() && startsWith(github.ref, 'refs/tags/')"
if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'schedule'
runs-on: ubuntu-latest

permissions:
id-token: write
contents: write

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v2
- name: 🐍 Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: install
- name: 👷 Build
run: |
git tag
pip install --upgrade pip
pip install -U build twine
python -m pip install build
python -m build
twine check dist/*
ls -lh dist

- name: Build and publish
run: twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
- name: 🚢 Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

- uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: "./dist/*"
66 changes: 29 additions & 37 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,30 @@
# enable pre-commit.ci at https://pre-commit.ci/
# it adds:
# 1. auto fixing pull requests
# 2. auto updating the pre-commit configuration
ci:
autoupdate_schedule: monthly
autofix_commit_msg: "style(pre-commit.ci): auto fixes [...]"
autoupdate_commit_msg: "ci(pre-commit.ci): autoupdate"

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-docstring-first
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.1
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies: [flake8-typing-imports]
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
args: ["--in-place", "--remove-all-unused-imports"]
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
hooks:
- id: mypy
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.16
hooks:
- id: validate-pyproject

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.4.1
hooks:
- id: ruff
args: [--fix, --unsafe-fixes]
- id: ruff-format

# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.9.0
# hooks:
# - id: mypy
# files: "^src/"
# # # you have to add the things you want to type check against here
# # additional_dependencies:
# # - numpy
6 changes: 2 additions & 4 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
BSD 3-Clause License

BSD License

Copyright (c) 2021, Talley Lambert
All rights reserved.
Copyright (c) 2023, Talley Lambert

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
8 changes: 0 additions & 8 deletions MANIFEST.in

This file was deleted.

11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
[![tests](https://github.com/tlambert03/anyfft/workflows/tests/badge.svg)](https://github.com/tlambert03/anyfft/actions)
[![codecov](https://codecov.io/gh/tlambert03/anyfft/branch/master/graph/badge.svg)](https://codecov.io/gh/tlambert03/anyfft)

anyfft is a thin compatibility layer that wraps various python FFT implementations in the `scipy.fft` API (if they do not already provide it). my motiviation is to have a package that I can install anywhere that will take advantage of the available hardware (CUDA, OpenCL, CPU fallback) without refactoring.

anyfft is a thin compatibility layer that wraps various python FFT
implementations in the `scipy.fft` API (if they do not already provide it). my
motivation is to have a package that I can install anywhere that will take
advantage of the available hardware (CUDA, OpenCL, CPU fallback) without
refactoring.

```python
import anyfft
Expand All @@ -19,7 +22,7 @@ anyfft.fft(array, plugin='reikna')
anyfft.reikna.fft(array)
```

### current backends:
## current backends

- numpy (`np.fft`)
- scipy (`scipy.fft`)
Expand All @@ -28,7 +31,7 @@ anyfft.reikna.fft(array)
- reikna (OpenCL FFT)
- cupy (CUDA FFT)

### available functions:
## available functions

fft, fft2, fftn, ifft, ifft2, ifftn, fftshift, ifftshift, irfft (reikna WIP), irfft2 (reikna WIP), irfftn (reikna WIP),
rfft, rfft2, rfftn
Expand Down
23 changes: 0 additions & 23 deletions anyfft/_backend.py

This file was deleted.

Loading