Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
761883a
add nbstripout pre-commit rule
thomas-hermann Oct 25, 2025
f01c495
Add ChainableArray class, 28 new mapping functions and numpy ufunc re…
thomas-hermann Oct 25, 2025
9561533
add pyamapping example notebook
thomas-hermann Oct 25, 2025
e3f866c
add linlin() examples
thomas-hermann Oct 27, 2025
dae8f72
improve linlin example
thomas-hermann Oct 27, 2025
f87bb01
add linexp() example
thomas-hermann Oct 27, 2025
6b3637a
refactor linlog to explin
thomas-hermann Oct 27, 2025
09851be
add explin() example
thomas-hermann Oct 27, 2025
c0482aa
improve lincurve mapping function
thomas-hermann Oct 30, 2025
30e7c9d
add lincurve example
thomas-hermann Oct 30, 2025
5b9306e
improve curvelin mapping function
thomas-hermann Oct 30, 2025
5f24f5e
add curvelin() example
thomas-hermann Oct 30, 2025
241b14c
add linpoly() example
thomas-hermann Oct 30, 2025
59aa1fc
improve structure and explanations
thomas-hermann Oct 30, 2025
a433b15
forward kwargs for interp_spline()
thomas-hermann Oct 30, 2025
02cbbcb
add bilin() example
thomas-hermann Oct 30, 2025
9592b2d
add interp_spline() example
thomas-hermann Oct 30, 2025
19d3942
add interp() example
thomas-hermann Oct 30, 2025
1d058a2
add clip() example
thomas-hermann Oct 31, 2025
ccb5286
add method shortcuts for midicps and cpsmidi
thomas-hermann Oct 31, 2025
131c5c3
add example for midi_to_cps()
thomas-hermann Oct 31, 2025
43fb224
add example for cps_to_midi()
thomas-hermann Oct 31, 2025
178edbd
add chain fn shortcuts midiratio and ratiomidi
thomas-hermann Oct 31, 2025
f57e2c6
add midi_to_ratio() example
thomas-hermann Oct 31, 2025
e8677ef
add ratio_to_midi() example
thomas-hermann Oct 31, 2025
9461c7e
register chain fn for cpsoct and octcps
thomas-hermann Oct 31, 2025
348504b
add octave_to_cps() and cps_to_octave() examples
thomas-hermann Oct 31, 2025
499ef14
register chain fn for ampdb and dbamp
thomas-hermann Oct 31, 2025
de86068
add db_to_amp() and amp_to_db() examples
thomas-hermann Oct 31, 2025
959efcb
update hz_to_mel(), mel_to_hz() docstring
thomas-hermann Nov 1, 2025
7af3570
add mel_to_hz() and hz_to_mel() examples
thomas-hermann Nov 1, 2025
7493c86
add Slaney mel scale to mel_to_hz() and hz_to_mel()
thomas-hermann Nov 1, 2025
db1a25e
improve mel_to_hz and hz_to_mel examples
thomas-hermann Nov 1, 2025
f691c09
add distort() example
thomas-hermann Nov 1, 2025
3cddd5b
improve softclip() code and docstring
thomas-hermann Nov 1, 2025
ae451d3
add softclip() example
thomas-hermann Nov 1, 2025
2eb1fc1
fix dtype bug in softclip(), improve scurve()
thomas-hermann Nov 1, 2025
ce80c0c
add scurve() example
thomas-hermann Nov 1, 2025
d9dc433
fix error in lcurve() docstring
thomas-hermann Nov 1, 2025
0a1050f
add lcurve() example
thomas-hermann Nov 1, 2025
080ddc1
fixed bug in wrap()
thomas-hermann Nov 1, 2025
992ba82
add wrap() example
thomas-hermann Nov 1, 2025
f0817f3
add fold() example
thomas-hermann Nov 1, 2025
24bb5c0
improve/correct fermi() docstring
thomas-hermann Nov 3, 2025
ce45ea8
add fermi() example
thomas-hermann Nov 3, 2025
558303c
fix normalize() input type
thomas-hermann Nov 3, 2025
9b50b9f
add normalize() example
thomas-hermann Nov 3, 2025
148ad03
fixed norm_peak() type definition
thomas-hermann Nov 3, 2025
4a7a42e
add norm_peak() example
thomas-hermann Nov 3, 2025
763c2cb
fix norm_rms() type definiton
thomas-hermann Nov 3, 2025
d97d533
add norm_rms() example
thomas-hermann Nov 3, 2025
c667391
fix remove_dc() type hints
thomas-hermann Nov 3, 2025
c869f41
add remove_dc() example
thomas-hermann Nov 3, 2025
fbeb49f
fix gain() type hints
thomas-hermann Nov 3, 2025
703ebd2
add gain() example
thomas-hermann Nov 3, 2025
ee852c4
fix remove_dc() type hint error
thomas-hermann Nov 4, 2025
e54692f
remove obsolete linspace()
thomas-hermann Nov 4, 2025
39f4aba
remove linspace(), fix lin_ecdf() extrapolation
thomas-hermann Nov 4, 2025
d72f1e5
add ecdf(), lin_to_ecdf(), ecdf_to_lin() examples
thomas-hermann Nov 4, 2025
e36bb85
update .plot() for mapping with xs arg
thomas-hermann Nov 4, 2025
0278178
fix linspace removal bug
thomas-hermann Nov 4, 2025
76c7ac4
Updated maximum python version for testing matrix in github workflow.
sherlockhommel Nov 5, 2025
bf3b982
correct wrap() example plot title
thomas-hermann Nov 5, 2025
d57f6cb
move ChainableArray to separate module
thomas-hermann Nov 5, 2025
a4b0d82
Added a few tests for mappings, also added scipy as a dependency to t…
sherlockhommel Nov 6, 2025
49b8cdb
add tests and update test function names
thomas-hermann Nov 6, 2025
417f0e9
add more tests
thomas-hermann Nov 6, 2025
f9efca5
Increased test coverage a tiny bit. Maybe need to switch to more elab…
sherlockhommel Mar 26, 2026
ede80c3
Started creating extensive text coverage with AI help. A few function…
sherlockhommel Mar 27, 2026
c3c4ddf
in-depth testing of all mapping functions
sherlockhommel Mar 31, 2026
324dc85
Basic test coverage for chainable array
sherlockhommel Mar 31, 2026
f091222
Initial steps of migrating build setup to uv
sherlockhommel Apr 14, 2026
cf75d3a
Repaired uv.lock
sherlockhommel Apr 14, 2026
68a8aab
Repaired uv.lock
sherlockhommel Apr 14, 2026
207c335
Repaired uv.lock
sherlockhommel Apr 14, 2026
e902846
Deleted unnecessary files, updated coverage configuration
sherlockhommel Apr 15, 2026
228c06c
Updated readme
sherlockhommel Apr 15, 2026
b81a35b
Updated readme
sherlockhommel Apr 15, 2026
b23207d
Udpated github actions
sherlockhommel Apr 28, 2026
41606f4
Merge branch 'feature/pyscaffold_to_uv' into develop
sherlockhommel Apr 28, 2026
b81d687
Updated versions of various actions, because older versions are using…
sherlockhommel Apr 28, 2026
ecf9d73
Pinned exact version of uv github action
sherlockhommel Apr 28, 2026
cb65c2a
fixed ruff error in pyproject.toml
sherlockhommel Apr 28, 2026
5a69e55
corrected indentation of conftest
sherlockhommel Apr 28, 2026
acfe10c
Switched to manual versioning
sherlockhommel Apr 28, 2026
1e3948d
incremented version to 1.0.0
sherlockhommel Apr 29, 2026
8df71fb
Merge branch 'release/1.0.0' into develop
sherlockhommel Apr 29, 2026
70816ee
Added manual dispatch to publish step in github workflow
sherlockhommel Apr 30, 2026
4d9b770
added debug step to finalize
sherlockhommel Apr 30, 2026
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
56 changes: 27 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,20 @@ jobs:
outputs:
wheel-distribution: ${{ steps.wheel-distribution.outputs.path }}
steps:
- uses: actions/checkout@v3
with: {fetch-depth: 0} # deep clone for setuptools-scm
- uses: actions/setup-python@v4
id: setup-python
with: {python-version: "3.11"}
- uses: actions/checkout@v5
with: {fetch-depth: 0} # deep clone for hatch-scm
- uses: astral-sh/setup-uv@v8.1.0
- name: Run static analysis and format checkers
run: pipx run pre-commit run --all-files --show-diff-on-failure
run: uv run pre-commit run --all-files --show-diff-on-failure
- name: Build package distribution files
run: >-
pipx run --python '${{ steps.setup-python.outputs.python-path }}'
tox -e clean,build
run: uv run tox -e clean,build
- name: Record the path of wheel distribution
id: wheel-distribution
run: echo "path=$(ls dist/*.whl)" >> $GITHUB_OUTPUT
- name: Store the distribution files for use in other stages
# `tests` and `publish` will use the same pre-built distributions,
# so we make sure to release the exact same package that was tested
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python-distribution-files
path: dist/
Expand All @@ -60,29 +56,28 @@ jobs:
strategy:
matrix:
python:
- "3.7" # oldest Python supported by PSF
- "3.11" # newest Python that is stable
- "3.10"
- "3.11" # oldest Python supported by PSF
- "3.12" # oldest Python supported by PSF
- "3.13" # oldest Python supported by PSF
- "3.14" # newest Python that is stable
platform:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
id: setup-python
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v8.1.0
with:
python-version: ${{ matrix.python }}
- name: Retrieve pre-built distribution files
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with: {name: python-distribution-files, path: dist/}
- name: Run tests
run: >-
pipx run --python '${{ steps.setup-python.outputs.python-path }}'
tox --installpkg '${{ needs.prepare.outputs.wheel-distribution }}'
uv run tox --installpkg '${{ needs.prepare.outputs.wheel-distribution }}'
-- -rFEx --durations 10 --color yes # pytest args
- name: Generate coverage report
run: pipx run coverage lcov -o coverage.lcov
- name: Upload partial coverage report
uses: coverallsapp/github-action@master
with:
Expand All @@ -100,26 +95,29 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
- name: debug
run: echo "ref=${{ github.ref }} event=${{ github.event_name }}"



publish:
needs: finalize
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
if: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && contains(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with: {python-version: "3.11"}
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v8.1.0
- name: Retrieve pre-built distribution files
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with: {name: python-distribution-files, path: dist/}
- name: Publish Package
env:
# TODO: Set your PYPI_TOKEN as a secret using GitHub UI
# - https://pypi.org/help/#apitoken
# - https://docs.github.com/en/actions/security-guides/encrypted-secrets
TWINE_REPOSITORY: pypi
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: pipx run tox -e publish
UV_PUBLISH_URL: https://upload.pypi.org/legacy/
UV_PUBLISH_USERNAME: __token__
UV_PUBLISH_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: uv run tox -e publish
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ MANIFEST
.venv*/
.conda*/
.python-version

# .env file for Environment Variables
.env
3 changes: 0 additions & 3 deletions .isort.cfg

This file was deleted.

62 changes: 16 additions & 46 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,67 +1,37 @@
exclude: '^docs/conf.py'
exclude: '^docs/conf.py|^uv\.lock$'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
exclude: uv.lock
- id: check-ast
- id: check-json
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: requirements-txt-fixer
exclude: "uv.lock"
- id: mixed-line-ending
exclude: "uv.lock"
args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows

## If you want to automatically "modernize" your Python code:
# - repo: https://github.com/asottile/pyupgrade
# rev: v3.7.0
# hooks:
# - id: pyupgrade
# args: ['--py37-plus']

## If you want to avoid flake8 errors due to unused vars or imports:
# - repo: https://github.com/PyCQA/autoflake
# rev: v2.1.1
# hooks:
# - id: autoflake
# args: [
# --in-place,
# --remove-all-unused-imports,
# --remove-unused-variables,
# ]

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.0 # check latest
hooks:
- id: isort
- id: ruff # replaces isort + flake8
args: [--fix] # auto-fix where possible
- id: ruff-format # replaces black

- repo: https://github.com/psf/black
rev: 23.7.0
- repo: https://github.com/kynan/nbstripout
rev: 0.8.1
hooks:
- id: black
language_version: python3
- id: nbstripout
args: [--extra-keys=metadata.kernelspec metadata.language_info]

## If like to embrace black styles even in the docs:
# - repo: https://github.com/asottile/blacken-docs
# rev: v1.13.0
# hooks:
# - id: blacken-docs
# additional_dependencies: [black]

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.6.0 # check latest
hooks:
- id: flake8
## You can add flake8 plugins via `additional_dependencies`:
# additional_dependencies: [flake8-bugbear]

## Check for misspells in documentation files:
# - repo: https://github.com/codespell-project/codespell
# rev: v2.2.5
# hooks:
# - id: codespell
- id: uv-lock # updates uv.lock when pyproject.toml changes
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2023 Dennis Reinsch
Copyright (c) 2023-2025 Thomas Hermann and Dennis Reinsch

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
66 changes: 54 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,65 @@ pyamapping
Making Changes & Contributing
=============================

This project uses `pre-commit`_, please make sure to install it before making any
changes::
To setup your development environment, you need to have `uv <https://docs.astral.sh/uv/>`_ installed.
First, clone the repository and then change into the root directory:

.. code-block:: bash

pip install pre-commit
cd pyamapping
pre-commit install

It is a good idea to update the hooks to the latest version::
Afterwards, sync your environment:

.. code-block:: bash

uv sync

This will install all required dependencies (dev dependencies included).
Also, please install the pre-commit hooks:

.. code-block:: bash

uv run pre-commit install

Experimentation in Scratchpad / Jupyter
----------------------------------------

uv automatically installs the ``pyamapping`` package to the ``.venv`` in editable mode.
During development, any changes to the ``pyamapping`` source will be reflected automatically.
To write playground / exploratory code, just make sure to run your REPL environment with ``uv run``, e.g.:

.. code-block:: bash

uv run python

or

.. code-block:: bash

uv run jupyter notebook

Then, you should be able to:

.. code-block:: python

import pyamapping as pam

And get the current state of the source code.

Running Tests
-------------

Tests can be run via:

.. code-block:: bash

pre-commit autoupdate
uv run tox -e tests

Don't forget to tell your contributors to also install and use pre-commit.
Building Documentation
----------------------

.. _pre-commit: https://pre-commit.com/
Documentation can be built via:

Note
====
.. code-block:: bash

This project has been set up using PyScaffold 4.5. For details and usage
information on PyScaffold see https://pyscaffold.org/.
uv run tox -e docs
Loading
Loading