Skip to content

Commit 29d5433

Browse files
committed
Merge branch 'master' into fix/remove_absorption_param
2 parents 967216b + b897953 commit 29d5433

File tree

6 files changed

+103
-41
lines changed

6 files changed

+103
-41
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 77 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: samplerate
1+
name: pyroomacoustics
22

33
on:
44
push:
@@ -8,8 +8,22 @@ on:
88
types: [opened, synchronize, reopened, labeled]
99
workflow_dispatch:
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
15+
setup-sofa:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Cache SOFA data
20+
uses: actions/cache@v4
21+
with:
22+
path: pyroomacoustics/data/sofa
23+
key: sofa-data-${{ hashFiles('pyroomacoustics/data/sofa_files.json') }}
24+
1225
build_sdist:
26+
needs: setup-sofa
1327
runs-on: ubuntu-latest
1428
steps:
1529
- uses: actions/checkout@v6
@@ -52,15 +66,22 @@ jobs:
5266
with:
5367
submodules: recursive
5468
fetch-depth: 0
69+
- name: Restore SOFA data
70+
uses: actions/cache/restore@v4
71+
with:
72+
path: pyroomacoustics/data/sofa
73+
key: sofa-data-${{ hashFiles('pyroomacoustics/data/sofa_files.json') }}
5574
- uses: pypa/cibuildwheel@v3.4.0
5675
env:
5776
CIBW_BUILD: ${{ matrix.cibw_build }}
5877
CIBW_ARCHS: ${{ matrix.cibw_archs }}
5978
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
6079
CIBW_TEST_REQUIRES: "pytest numpy scipy matplotlib python-sofa soxr"
6180
CIBW_TEST_COMMAND: "pytest {project}/tests"
81+
CIBW_ENVIRONMENT: PYROOMACOUSTICS_DATA_PATH={project}/pyroomacoustics/data/sofa
6282

6383
build_wheels:
84+
needs: setup-sofa
6485
if: >-
6586
github.event_name == 'push' ||
6687
github.event_name == 'workflow_dispatch' ||
@@ -69,71 +90,97 @@ jobs:
6990
strategy:
7091
fail-fast: false
7192
matrix:
72-
os: [ubuntu-latest, macos-latest, windows-latest]
93+
include:
94+
# Linux x86_64
95+
- { os: ubuntu-latest, python: "cp39-*", arch: "x86_64" }
96+
- { os: ubuntu-latest, python: "cp310-*", arch: "x86_64" }
97+
- { os: ubuntu-latest, python: "cp311-*", arch: "x86_64" }
98+
- { os: ubuntu-latest, python: "cp312-*", arch: "x86_64" }
99+
- { os: ubuntu-latest, python: "cp313-*", arch: "x86_64" }
100+
- { os: ubuntu-latest, python: "cp314-*", arch: "x86_64" }
101+
# Linux aarch64
102+
- { os: ubuntu-latest, python: "cp311-*", arch: "aarch64" }
103+
- { os: ubuntu-latest, python: "cp312-*", arch: "aarch64" }
104+
- { os: ubuntu-latest, python: "cp313-*", arch: "aarch64" }
105+
- { os: ubuntu-latest, python: "cp314-*", arch: "aarch64" }
106+
# MacOS (universal2 builds both x86_64 and arm64)
107+
- { os: macos-latest, python: "cp39-*", arch: "universal2" }
108+
- { os: macos-latest, python: "cp310-*", arch: "universal2" }
109+
- { os: macos-latest, python: "cp311-*", arch: "universal2" }
110+
- { os: macos-latest, python: "cp312-*", arch: "universal2" }
111+
- { os: macos-latest, python: "cp313-*", arch: "universal2" }
112+
- { os: macos-latest, python: "cp314-*", arch: "universal2" }
113+
# Windows
114+
- { os: windows-latest, python: "cp39-*", arch: "AMD64" }
115+
- { os: windows-latest, python: "cp310-*", arch: "AMD64" }
116+
- { os: windows-latest, python: "cp311-*", arch: "AMD64" }
117+
- { os: windows-latest, python: "cp312-*", arch: "AMD64" }
118+
- { os: windows-latest, python: "cp313-*", arch: "AMD64" }
119+
- { os: windows-latest, python: "cp314-*", arch: "AMD64" }
73120
steps:
74121
- uses: actions/checkout@v6
75122
with:
76123
submodules: recursive
77124
fetch-depth: 0
78125
- name: Set up QEMU
79-
if: runner.os == 'Linux'
126+
if: runner.os == 'Linux' && matrix.arch == 'aarch64'
80127
uses: docker/setup-qemu-action@v3
81128
with:
82129
platforms: all
130+
- name: Restore SOFA data
131+
uses: actions/cache/restore@v4
132+
with:
133+
path: pyroomacoustics/data/sofa
134+
key: sofa-data-${{ hashFiles('pyroomacoustics/data/sofa_files.json') }}
83135
- uses: pypa/cibuildwheel@v3.4.0
84136
env:
85-
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*"
86-
CIBW_SKIP: "*-musllinux_* cp39-*aarch64 cp310-*aarch64"
87-
CIBW_ARCHS_LINUX: "x86_64 aarch64"
88-
CIBW_ARCHS_MACOS: "universal2"
89-
CIBW_ARCHS_WINDOWS: "AMD64"
137+
CIBW_BUILD: ${{ matrix.python }}
138+
CIBW_ARCHS: ${{ matrix.arch }}
139+
CIBW_SKIP: "*-musllinux_*"
90140
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
91141
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
92142
CIBW_TEST_REQUIRES: "pytest numpy scipy matplotlib python-sofa soxr"
93143
CIBW_TEST_COMMAND: "pytest {project}/tests"
94144
CIBW_TEST_SKIP: "cp314-*"
145+
CIBW_ENVIRONMENT: PYROOMACOUSTICS_DATA_PATH={project}/pyroomacoustics/data/sofa
95146
- uses: actions/upload-artifact@v6
96147
with:
97-
name: wheels-${{ matrix.os }}
148+
name: cibw-wheels-${{ matrix.os }}-${{ matrix.arch }}-${{ strategy.job-index }}
98149
path: wheelhouse/*.whl
99150

100151
publish:
101152
needs: [build_sdist, build_wheels]
102153
runs-on: ubuntu-latest
103154
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
155+
environment: pypi
156+
permissions:
157+
id-token: write # MANDATORY for OIDC publishing
104158
steps:
105-
- uses: actions/download-artifact@v8
159+
- uses: actions/download-artifact@v4
106160
with:
107161
path: dist
108162
merge-multiple: true
109-
- name: Validate wheels
110-
run: |
111-
pip install --upgrade twine packaging
112-
twine check dist/*
113163
- name: Publish to PyPI
114-
env:
115-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
116-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
117-
run: |
118-
twine upload --skip-existing dist/*
164+
uses: pypa/gh-action-pypi-publish@release/v1
165+
with:
166+
verbose: true
167+
attestations: false
119168

120169
publish-test:
121170
needs: [build_sdist, build_wheels]
122171
runs-on: ubuntu-latest
123172
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/test-')
173+
environment: testpypi
174+
permissions:
175+
id-token: write # MANDATORY for OIDC publishing
124176
steps:
125-
- uses: actions/download-artifact@v8
177+
- uses: actions/download-artifact@v4
126178
with:
127179
path: dist
128180
merge-multiple: true
129-
- name: Validate wheels
130-
run: |
131-
pip install --upgrade twine packaging
132-
twine check dist/*
133181
- name: Publish to PyPI Test
134-
env:
135-
TWINE_USERNAME: ${{ secrets.PYPITEST_USERNAME }}
136-
TWINE_PASSWORD: ${{ secrets.PYPITEST_PASSWORD }}
137-
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
138-
run: |
139-
twine upload --skip-existing dist/*
182+
uses: pypa/gh-action-pypi-publish@release/v1
183+
with:
184+
repository-url: https://test.pypi.org/legacy/
185+
verbose: true
186+
attestations: false

CHANGELOG.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ adheres to `Semantic Versioning <http://semver.org/spec/v2.0.0.html>`_.
1414
Changed
1515
~~~~~~~
1616

17-
- Removed the deprecated ``absorption`` parameter from ``ShoeBox``,
18-
``Room.from_corners``, and ``Room.extrude``.
1917
- Modernized the build system to use ``pyproject.toml`` and ``CMake``.
20-
- External dependencies (``Eigen``, ``nanoflann``, ``pybind11``) are now automatically managed via CMake's ``FetchContent``.
18+
- External dependencies (``Eigen``, ``nanoflann``, ``pybind11``) are now
19+
automatically managed via CMake's ``FetchContent``.
2120
- Switched to dynamic versioning using ``setuptools_scm``.
2221
- Relocated the test suite from the source package to a top-level ``tests/`` directory.
23-
- Update the continuous integration to use cibuildwheel to handle all platforms including manylinux.
22+
- Update the continuous integration to use cibuildwheel to handle all platforms
23+
including manylinux.
24+
- The location of the SOFA files can be specified by the
25+
``PYROOMACOUSTICS_DATA_PATH`` environment variable.
2426

2527

2628
`0.10.0`_ - 2026-04-01

MANIFEST.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,12 @@ graft tests/transform
3030

3131
global-exclude *.py[co]
3232
global-exclude __pycache__
33+
34+
# Exclude large data files from sdist to keep it under 100MB
35+
recursive-exclude pyroomacoustics/data/sofa *.sofa
36+
recursive-exclude examples *
37+
recursive-exclude notebooks *
38+
recursive-exclude logo *
39+
recursive-exclude offline_packages *
40+
recursive-exclude docs *
41+
recursive-exclude build_debug *

pyproject.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description = "A simple framework for room acoustics and audio processing in Pyt
99
authors = [
1010
{ name = "Laboratory for Audiovisual Communications, EPFL", email = "fakufaku@gmail.ch" }
1111
]
12-
license = "MIT"
12+
license = { file = "LICENSE" }
1313
keywords = ["room", "acoustics", "signal processing", "doa", "beamforming", "adaptive"]
1414
classifiers = [
1515
"Development Status :: 4 - Beta",
@@ -66,10 +66,6 @@ pyroomacoustics = [
6666
"*.pyx",
6767
"data/materials.json",
6868
"data/sofa_files.json",
69-
"data/sofa/AKG_c480_c414_CUBE.sofa",
70-
"data/sofa/EM32_Directivity.sofa",
71-
"data/sofa/mit_kemar_large_pinna.sofa",
72-
"data/sofa/mit_kemar_normal_pinna.sofa",
7369
]
7470

7571
[tool.setuptools_scm]

pyroomacoustics/datasets/sofa.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,25 @@
6767
for more details.
6868
6969
70+
71+
The default location for the SOFA files is in the ``data/sofa`` folder of
72+
the ``pyroomacoustics`` package. This location can be overridden by setting the
73+
environment variable ``PYROOMACOUSTICS_DATA_PATH`` to a different path.
74+
7075
"""
7176

7277
import json
78+
import os
7379
import typing as tp
7480
from dataclasses import dataclass
7581
from pathlib import Path
7682

7783
from .utils import AttrDict, download_multiple
7884

7985
_pra_data_folder = Path(__file__).parents[1] / "data"
80-
DEFAULT_SOFA_PATH = _pra_data_folder / "sofa"
86+
DEFAULT_SOFA_PATH = Path(
87+
os.environ.get("PYROOMACOUSTICS_DATA_PATH", _pra_data_folder / "sofa")
88+
)
8189
SOFA_INFO = _pra_data_folder / "sofa_files.json"
8290

8391
_DIRPAT_FILES = [

tests/test_rt_multiband_energy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def test_energy_decay_ism_vs_rt(samplerate, scene_geometry, wall_material):
173173
assert irer_db >= 10.0, f"Failed IRER {irer_db:.2f} dB < 10.0"
174174

175175
bws = room.octave_bands.get_bw()
176-
tols = [0.30, 0.15, 0.08]
176+
tols = [0.30, 0.20, 0.08]
177177
for b, bw in enumerate(np.sort(bws)): # Loop through every band
178178
rir_band_ism = room.octave_bands.analysis(rir_ism, band=b)
179179
rir_band_rt = room.octave_bands.analysis(rir_rt, band=b)

0 commit comments

Comments
 (0)