Skip to content

Commit

Permalink
Mave to emsig; update repo
Browse files Browse the repository at this point in the history
- Move from ``prisae`` to ``emsig``.
- Changed from ``setup.py`` to ``pyproject.toml``.
- Ready for numpy v2.
- Updated all CI.
- Change from ``master`` to ``main``.
- Add Makefile.
- Add monthly tests.
  • Loading branch information
prisae authored Oct 18, 2024
1 parent d09623c commit 69a0ce6
Show file tree
Hide file tree
Showing 21 changed files with 226 additions and 138 deletions.
2 changes: 0 additions & 2 deletions .coveragerc

This file was deleted.

3 changes: 3 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git_archival.txt export-subst
64 changes: 32 additions & 32 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
name: pytest

# Only build PRs, the master branch, and releases.
# Only build PRs, the main branch, and releases.
on:
pull_request:
push:
branches:
- master
- main
release:
types:
- published
schedule:
- cron: "14 14 20 * *"

# Cancel any previous run of the test job.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
Expand All @@ -19,7 +26,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu, ] # macos, windows] # Only Linux currently.
python-version: [3.6, 3.7, 3.8]
python-version: ["3.10", "3.11", "3.12"]

env:
# Used for coveralls flag
Expand All @@ -28,15 +35,9 @@ jobs:

steps:

# Cancel any previous run of the test job; [pin v0.6.0]
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@ce177499ccf9fd2aded3b0426c97e5434c2e8a73
with:
access_token: ${{ github.token }}

# Checks-out your repository under $GITHUB_WORKSPACE
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# Need to fetch more than the last commit so that setuptools_scm can
# create the correct version string. If the number of commits since
Expand All @@ -52,21 +53,24 @@ jobs:
run: git fetch origin 'refs/tags/*:refs/tags/*'

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
python -m pip install .[all]
- name: Flake8
run: flake8 docs/conf.py pyfftlog/ tests/ examples/

- name: Test with pytest
run: pytest --cov=pyfftlog --flake8
run: pytest --cov=pyfftlog

- name: Coveralls
# [pin v20201129]
uses: AndreMiras/coveralls-python-action@f5fd5c309b39d01599fb92c72d4f7409ea78aec9
# [pin @develop@20230609]
uses: AndreMiras/coveralls-python-action@65c1672f0b8a201702d86c81b79187df74072505
with:
parallel: true
flag-name: ${{ matrix.python-version }} (${{ matrix.os }})
Expand All @@ -77,22 +81,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
# [pin v20201129]
uses: AndreMiras/coveralls-python-action@f5fd5c309b39d01599fb92c72d4f7409ea78aec9
# [pin @develop@20230609]
uses: AndreMiras/coveralls-python-action@65c1672f0b8a201702d86c81b79187df74072505
with:
parallel-finished: true

deploy:
needs: test
name: Deploy to PyPI
runs-on: ubuntu-latest
# Only from the origin repository, not forks; only master and tags.
if: github.repository_owner == 'prisae' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
# Only from the origin repository, not forks; only main and tags.
if: github.repository_owner == 'emsig' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))

steps:
# Checks-out your repository under $GITHUB_WORKSPACE
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# Need to fetch more than the last commit so that setuptools_scm can
# create the correct version string. If the number of commits since
Expand All @@ -108,37 +112,34 @@ jobs:
run: git fetch origin 'refs/tags/*:refs/tags/*'

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
pip install -r requirements-dev.txt
python -m pip install build setuptools-scm
- name: Build source and wheel distributions
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/main'
run: |
# Change setuptools-scm local_scheme to "no-local-version" so the
# local part of the version isn't included, making the version string
# compatible with Test PyPI.
sed --in-place "s/'root'/'local_scheme':'no-local-version','root'/g" setup.py
sed --in-place 's/version_file/local_scheme = "no-local-version"\nversion_file/g' pyproject.toml
- name: Build source and wheel distributions
run: |
# Build source and wheel packages
python setup.py sdist
python setup.py bdist_wheel
python -m build
echo ""
echo "Generated files:"
ls -lh dist/
- name: Publish to Test PyPI
if: success()
# Hash corresponds to v1.4.1
uses: pypa/gh-action-pypi-publish@54b39fb9371c0b3a6f9f14bb8a67394defc7a806
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_PASSWORD }}
Expand All @@ -150,8 +151,7 @@ jobs:
- name: Publish to PyPI
# Only for releases
if: success() && github.event_name == 'release'
# Hash corresponds to v1.4.1
uses: pypa/gh-action-pypi-publish@54b39fb9371c0b3a6f9f14bb8a67394defc7a806
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ __pycache__/
# Sphinx
docs/_build/
docs/examples/
docs/sg_execution_times.rst

# Pytest and coverage related
htmlcov
Expand Down
23 changes: 23 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Required
version: 2

build:
os: "ubuntu-22.04"
tools:
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
formats: []

# Optionally set the version of Python and requirements required to build your
# docs
python:
install:
- method: pip
path: .
extra_requirements:
- docs
16 changes: 16 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@ Changelog
#########


v0.2.1 : emsig
--------------

**2024-10-18**

Maintenance

- Move from ``prisae`` to ``emsig``.
- Changed from ``setup.py`` to ``pyproject.toml``.
- Ready for numpy v2.
- Updated all CI.
- Change from ``master`` to ``main``.
- Add Makefile.
- Add monthly tests.


v0.2.0 : First packaged release
-------------------------------

Expand Down
11 changes: 7 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
prune docs
prune tests
prune examples
exclude requirements.txt
exclude requirements-dev.txt
exclude .readthedocs.yml
prune .github
exclude MANIFEST.in
exclude CHANGELOG.rst
exclude Makefile
exclude .gitignore
exclude .coveragerc
exclude .readthedocs.yml
exclude .git_archival.txt
exclude .gitattributes
48 changes: 48 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
help:
@echo "Commands:"
@echo ""
@echo " install install in editable mode"
@echo " dev-install install in editable mode with dev requirements"
@echo " pytest run the test suite and report coverage"
@echo " flake8 style check with flake8"
@echo " html build docs (update existing)"
@echo " html-clean build docs (new, removing any existing)"
@echo " preview renders docs in Browser"
@echo " linkcheck check all links in docs"
@echo " clean clean up all generated files"
@echo ""

install:
python -m pip install -e .

dev-install:
python -m pip install -e .[all]

.ONESHELL:
pytest:
rm -rf .coverage htmlcov/ .pytest_cache/
pytest --cov=pyfftlog --mpl
coverage html

flake8:
flake8 docs/conf.py pyfftlog/ tests/ examples/

html:
cd docs && make html

html-clean:
cd docs && rm -rf examples/* _build/ && make html

preview:
xdg-open docs/_build/html/index.html

linkcheck:
cd docs && make linkcheck

clean:
python -m pip uninstall pyfftlog -y
rm -rf build/ dist/ .eggs/ pyfftlog.egg-info/ pyfftlog/version.py # build
rm -rf */__pycache__/ */*/__pycache__/ # python cache
rm -rf .coverage htmlcov/ .pytest_cache/ # tests and coverage
rm -rf docs/_build/ docs/examples/* # docs
rm docs/sg_execution_times.rst
33 changes: 8 additions & 25 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,30 +1,13 @@
.. image:: https://readthedocs.org/projects/pyfftlog/badge/?version=latest
:target: https://pyfftlog.readthedocs.io/en/latest
:alt: Documentation Status
.. image:: https://github.com/prisae/pyfftlog/workflows/pytest/badge.svg?branch=master
:target: https://github.com/prisae/pyfftlog/actions
:alt: GitHub Actions
.. image:: https://coveralls.io/repos/github/prisae/pyfftlog/badge.svg?branch=master
:target: https://coveralls.io/github/prisae/pyfftlog?branch=master
:alt: Coveralls
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3830364.svg
:target: https://doi.org/10.5281/zenodo.3830364
:alt: Zenodo DOI


.. sphinx-inclusion-marker
`pyfftlog` - A python version of FFTLog
=======================================

This is a python version of the logarithmic FFT code *FFTLog* as presented in
Appendix B of `Hamilton (2000)
<http://dx.doi.org/10.1046/j.1365-8711.2000.03071.x>`_ and published at
`casa.colorado.edu/~ajsh/FFTLog <http://casa.colorado.edu/~ajsh/FFTLog>`_.
<https://dx.doi.org/10.1046/j.1365-8711.2000.03071.x>`_ and published at
`jila.colorado.edu/~ajsh/FFTLog <https://jila.colorado.edu/~ajsh/FFTLog>`_.

A simple `f2py`-wrapper (`fftlog`) can be found on `github.com/prisae/fftlog
<https://github.com/prisae/fftlog>`_. Tests have shown that `fftlog` is a bit
A simple `f2py`-wrapper (`fftlog`) can be found on `github.com/emsig/fftlog
<https://github.com/emsig/fftlog>`_. Tests have shown that `fftlog` is a bit
faster than `pyfftlog`, but `pyfftlog` is easier to implement, as you only need
`NumPy` and `SciPy`, without the need to compile anything.

Expand All @@ -38,7 +21,7 @@ test from the original code, and my use case, which is `pyfftlog.fftl` with
(forward). Please let me know if you encounter any issues.

- **Documentation**: https://pyfftlog.readthedocs.io
- **Source Code**: https://github.com/prisae/pyfftlog
- **Source Code**: https://github.com/emsig/pyfftlog


Description of FFTLog from the FFTLog-Website
Expand All @@ -62,8 +45,8 @@ Hankel transform.
The FFTLog algorithm was originally proposed by `Talman (1978)
<http://dx.doi.org/10.1016/0021-9991(78)90107-9>`_.

*For the full documentation, see* `casa.colorado.edu/~ajsh/FFTLog
<http://casa.colorado.edu/~ajsh/FFTLog>`_.
*For the full documentation, see* `jila.colorado.edu/~ajsh/FFTLog
<https://jila.colorado.edu/~ajsh/FFTLog>`_.


Installation
Expand Down Expand Up @@ -92,7 +75,7 @@ All releases have a Zenodo-DOI, which can be found on `10.5281/zenodo.3830364
<https://doi.org/10.5281/zenodo.3830364>`_.

Be kind and give credits by citing `Hamilton (2000)
<http://dx.doi.org/10.1046/j.1365-8711.2000.03071.x>`_. See the
<https://dx.doi.org/10.1046/j.1365-8711.2000.03071.x>`_. See the
`references-section
<https://pyfftlog.readthedocs.io/en/stable/references.html>`_ in the manual for
full references.
Loading

0 comments on commit 69a0ce6

Please sign in to comment.