Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
584 commits
Select commit Hold shift + click to select a range
e84c161
quadrature'``. The default is `
xefonon Jun 11, 2025
694b72a
Merge branch 'develop' into feature/consistent_sampling_names
f-brinkmann Jun 13, 2025
9a6f2a9
Merge pull request #142 from pyfar/deprecate/scipy_sph_harm
f-brinkmann Jun 13, 2025
7e980e3
Merge pull request #158 from pyfar/bug/fliege_classification
f-brinkmann Jun 13, 2025
0331aac
Merge pull request #135 from pyfar/feature/consistent_sampling_names
f-brinkmann Jun 13, 2025
e2c2ef2
Remove warning for pseudo-inverse fallback when coordinates are not S…
xefonon Jun 13, 2025
95013a7
Merge remote-tracking branch 'origin/develop' into sh_class_manual_cl…
xefonon Jun 13, 2025
0ed8973
Fix circular imports
xefonon Jun 13, 2025
8c82a86
Refactor import of SamplingSphere to use spharpy namespace
xefonon Jun 14, 2025
d35799b
Merge pull request #101 from pyfar/sh_class_manual_cleanup
xefonon Jun 14, 2025
7ac33d6
move sh class to classes folder
xefonon Jun 15, 2025
889380c
move sh class to classes folder
xefonon Jun 15, 2025
1f58e53
add missing documentation of parameters in plot module
ahms5 Jun 15, 2025
e8c143d
add tests with defaults for plot
ahms5 Jun 15, 2025
9526443
add tests output to gitignore
ahms5 Jun 15, 2025
e052190
add initial tests
ahms5 Jun 15, 2025
79bd01e
Revert "add missing documentation of parameters in plot module"
ahms5 Jun 15, 2025
cb3164f
remove baseline
ahms5 Jun 15, 2025
d2dc672
Merge branch 'develop' into ruff/doc
ahms5 Jun 15, 2025
6f95cf5
revert wrong push
ahms5 Jun 15, 2025
f74f066
improve projection doc in plot module
ahms5 Jun 15, 2025
d9ceca0
remove old fixture for pyfar and spharpy coordinates tests
ahms5 Jun 15, 2025
9abdd62
add remaining tests
ahms5 Jun 15, 2025
8bc3488
allow check for N=0
tluebeck Jun 16, 2025
9fe455b
Merge branch 'develop' into feature/check_sampling_quadrature
tluebeck Jun 17, 2025
689ed0d
Merge pull request #160 from pyfar/update/sh_classes_structure_and_docs
f-brinkmann Jun 17, 2025
d865919
Merge branch 'develop' into plot_revise_tests
ahms5 Jun 18, 2025
0f4b767
Merge branch 'develop' into ruff/doc
ahms5 Jun 18, 2025
6eb7220
fix ruff
ahms5 Jun 18, 2025
069a0d5
Update test_special.py
ahms5 Jun 29, 2025
3361d29
Update spharpy/beamforming/beamforming.py
ahms5 Jun 29, 2025
935de18
Apply suggestions from code review
ahms5 Jun 29, 2025
ee2833c
apply review
ahms5 Jun 29, 2025
48bd8bd
Merge branch 'develop' into ruff/B
ahms5 Jun 29, 2025
3843f8c
fix ruff in samplings
ahms5 Jun 29, 2025
128ab89
Merge branch 'develop' into feature/check_sampling_quadrature
tluebeck Jul 1, 2025
785762a
add quadrature check to weights setter
tluebeck Jul 1, 2025
42a6f52
update according to review
tluebeck Jul 2, 2025
1a747c2
Merge pull request #150 from pyfar/ruff/E
mberz Jul 3, 2025
6dbf7cc
Update spharpy/spherical.py
ahms5 Jul 3, 2025
aacba8d
Update spharpy/transforms/__init__.py
ahms5 Jul 3, 2025
02c5f08
Update spharpy/classes/audio.py
ahms5 Jul 3, 2025
945b011
Update spharpy/spatial/spatial.py
ahms5 Jul 3, 2025
8fc0bc6
Update spharpy/spatial/__init__.py
ahms5 Jul 3, 2025
a9277bc
Update spharpy/samplings/interior.py
ahms5 Jul 3, 2025
753e1b1
apply review
ahms5 Jul 3, 2025
f2bf38e
add `` to harmonize style
ahms5 Jul 3, 2025
505e724
Merge branch 'develop' into ruff/doc
ahms5 Jul 3, 2025
6ce361b
fix ruff comming from develop
ahms5 Jul 3, 2025
ff9aaf7
apply review remove unused checks
ahms5 Jul 4, 2025
5fc1c3c
fix ruff comming from develop
ahms5 Jul 3, 2025
d9768df
fix ruff
ahms5 Jul 4, 2025
855228a
Revert "fix ruff comming from develop"
ahms5 Jul 4, 2025
d728db5
Apply suggestions from code review
ahms5 Jul 4, 2025
3c0738a
Merge pull request #148 from pyfar/ruff/B
mberz Jul 4, 2025
5191750
Merge branch 'develop' into ruff/doc
ahms5 Jul 4, 2025
e335e7b
Merge branch 'develop' into plot_revise_tests
ahms5 Jul 4, 2025
c5fe224
remove quadrature setter
tluebeck Jul 7, 2025
f3215ef
bugfixes
tluebeck Jul 7, 2025
a1531c1
edit tests
tluebeck Jul 9, 2025
41864a5
edit tests
tluebeck Jul 9, 2025
69b36f1
update according to review
tluebeck Jul 11, 2025
92b9da5
apply review
ahms5 Jul 16, 2025
5033ff0
Merge branch 'develop' into ruff/fix_develop
ahms5 Jul 25, 2025
0c77c6c
Merge pull request #164 from pyfar/ruff/fix_develop
f-brinkmann Jul 25, 2025
5e1bd12
Merge branch 'develop' into ruff/doc
ahms5 Jul 25, 2025
757a089
fix ruff
ahms5 Jul 25, 2025
afe7dd2
Merge pull request #149 from pyfar/ruff/doc
f-brinkmann Jul 25, 2025
f41681c
Merge branch 'develop' into plot_revise_tests
ahms5 Jul 25, 2025
98683e9
start fixing the tests
ahms5 Jul 25, 2025
9fc80a2
add pyflakes rules
f-brinkmann Jul 26, 2025
4b3baaf
add PEP8 warnings
f-brinkmann Jul 26, 2025
3c7b835
add pytest style rules
f-brinkmann Jul 26, 2025
bbe5767
remove commented out code
f-brinkmann Jul 26, 2025
69117a0
add trailing comma rule
f-brinkmann Jul 26, 2025
b9a754c
add missing docstings
f-brinkmann Jul 26, 2025
ae85a5c
introduce new normalizations nm and snm
tluebeck Jul 28, 2025
e787193
rename "type" parameters to avoid shadowing
hoyer-a Jul 28, 2025
99491c3
implement new normalizations
tluebeck Jul 28, 2025
011ddad
update according to review
tluebeck Jul 29, 2025
a324c97
Merge branch 'develop' into feature/check_sampling_quadrature
tluebeck Jul 29, 2025
4c0e204
Merge branch 'develop' into feature/new_sh_normalizations
tluebeck Jul 29, 2025
ccde7e8
update renormalization
tluebeck Jul 29, 2025
8ce1958
update tests
tluebeck Jul 29, 2025
a0186cf
test renormalization
tluebeck Jul 29, 2025
1bcbe8c
add tests for sh_bases
tluebeck Jul 29, 2025
13bed86
fix tests
ahms5 Jul 29, 2025
98c1c5a
add baseline for test_sampling_scatter
ahms5 Jul 29, 2025
b4570fc
add baseline for test_spherical_default
ahms5 Jul 29, 2025
143709d
add baseline for test_spherical_cmap
ahms5 Jul 29, 2025
5586cf3
add baseline for test_spherical_colorbar
ahms5 Jul 29, 2025
593491b
add baseline for test_spherical_limits
ahms5 Jul 29, 2025
aac4af2
add baseline for test_spherical_phase
ahms5 Jul 29, 2025
0708091
add baseline for test_spherical_projection
ahms5 Jul 29, 2025
c8de085
add baseline for test_spherical_levels
ahms5 Jul 29, 2025
8dfb681
cosmetics
ahms5 Jul 29, 2025
a4a96cb
comment error
ahms5 Jul 29, 2025
13855be
edit docu
tluebeck Jul 29, 2025
2e57b80
add tests for custom ax 3d
ahms5 Jul 29, 2025
3231ea4
test for all ax
ahms5 Jul 29, 2025
538b1e2
cleanup tests plot
ahms5 Jul 29, 2025
18c23f3
Update spharpy/samplings/helpers.py
ahms5 Jul 29, 2025
93f1fb3
Apply suggestions from code review
ahms5 Jul 29, 2025
4af9443
fix tests
ahms5 Jul 29, 2025
13f3f60
Apply suggestions from code review
ahms5 Jul 29, 2025
7e12a7a
update according to review
tluebeck Jul 31, 2025
0c84905
fix typo
tluebeck Aug 5, 2025
1bf6f79
fix ruff errors
tluebeck Aug 5, 2025
e75f57c
update according to review
tluebeck Aug 6, 2025
1825a3c
Merge pull request #171 from pyfar/fix/ruff-shadowing
mberz Aug 8, 2025
09ea489
Merge branch 'develop' into enhance/ruff
f-brinkmann Aug 8, 2025
f9b651a
Merge pull request #170 from pyfar/enhance/ruff
f-brinkmann Aug 8, 2025
75e4fad
edit docstring according to review
tluebeck Aug 26, 2025
90fa45d
edit doc
tluebeck Aug 26, 2025
f8de2df
update according to review
tluebeck Aug 26, 2025
59e511a
Merge branch 'develop' into feature/new_sh_normalizations
tluebeck Aug 26, 2025
59cfd34
edit test
tluebeck Aug 26, 2025
8a5fade
fix ruff errors
tluebeck Aug 31, 2025
0c8d9d3
ruff fix
tluebeck Aug 31, 2025
7bccc67
add **kwargs were possible
ahms5 Sep 12, 2025
6632b42
Merge branch 'develop' into plot_revise_tests
ahms5 Sep 12, 2025
97b6ba3
fix ruff
ahms5 Sep 12, 2025
b7f471d
Update spharpy/plot/spatial.py
ahms5 Sep 15, 2025
fa52e19
Merge branch 'develop' into feature/check_sampling_quadrature
mberz Sep 16, 2025
7ec3818
Merge pull request #156 from pyfar/feature/check_sampling_quadrature
mberz Sep 16, 2025
2e498cc
Merge branch 'main' into develop
mberz Sep 16, 2025
af42dea
remove save axes input test
ahms5 Sep 17, 2025
31d2b7f
fix doc for cmap
ahms5 Sep 17, 2025
dcd1caa
Merge branch 'develop' into feature/new_sh_normalizations
tluebeck Sep 18, 2025
6912751
Update tests/test_plots.py
ahms5 Sep 18, 2025
95ff3c6
apply review by @mberz
ahms5 Sep 18, 2025
b90f928
Apply suggestions from code review
ahms5 Sep 18, 2025
4c2bc3a
deactivate create_baseline
ahms5 Sep 18, 2025
1022e64
add test for refine parameter in pcolor_map
ahms5 Sep 18, 2025
85a8507
set baseline to False
ahms5 Sep 18, 2025
090a150
make doc easier to read
ahms5 Sep 18, 2025
c58bfdb
Update tests/test_plots.py
ahms5 Sep 19, 2025
dadb7c3
Merge pull request #162 from pyfar/plot_revise_tests
ahms5 Sep 19, 2025
b9faa24
apply review
ahms5 Sep 19, 2025
e42d7a3
update according to review
tluebeck Sep 19, 2025
4017a53
capitalize normalization names
tluebeck Sep 20, 2025
fcea6e8
fix ruff on develop
ahms5 Sep 19, 2025
fb2cab9
add test for cmap phase_twilight
ahms5 Sep 18, 2025
27c9ad3
fix comment
ahms5 Sep 18, 2025
db5cb34
fix comments in test
ahms5 Sep 18, 2025
f175674
improve documentation
ahms5 Sep 18, 2025
121af33
Update spharpy/plot/cmap.py
ahms5 Sep 19, 2025
a4f9af3
Change colormap encoding parameter in wireframe balloon
mberz Sep 17, 2025
f15cd9d
update cmap encoding input in balloon
mberz Sep 17, 2025
85f4ffe
update cmap encoding parameter in pcolor_sphere
mberz Sep 17, 2025
b080331
update tests for balloon plots to cmap_encoding input
mberz Sep 18, 2025
43157ef
output file naming
mberz Sep 18, 2025
0043f48
Update baselines
mberz Sep 18, 2025
4aff058
Baseline file renaming suggested by @ahms5
mberz Sep 22, 2025
2327095
revise docstrings
mberz Sep 22, 2025
8912147
Merge pull request #186 from pyfar/add_test_plot_refine
f-brinkmann Sep 24, 2025
25457da
cleanup doc imports
ahms5 Jun 1, 2025
338919e
add fail with warning to ci for build doc
ahms5 Jun 1, 2025
af10f42
remove special module
ahms5 Jun 15, 2025
ada79ac
Revert "remove special module"
ahms5 Jun 15, 2025
93535e7
remove special module from doc
ahms5 Jun 15, 2025
97942b9
add special according to review
ahms5 Jul 4, 2025
6181f5b
fix footnote to remove warnings from docbuild
ahms5 Jul 4, 2025
f8e0c99
Update spharpy/spherical.py
ahms5 Sep 19, 2025
192040f
Update docs/api_reference.rst
ahms5 Sep 19, 2025
32bc606
fix docs warning
ahms5 Sep 19, 2025
99b07b4
apply review
ahms5 Sep 19, 2025
502ec57
Fix references gradient spherical harmonics
mberz Sep 26, 2025
cbcb26a
harmonize contour / contour_map; bugfixes
hoyer-a Sep 18, 2025
d5f888a
adjust docs
hoyer-a Sep 18, 2025
bb74d42
fix ruff
hoyer-a Sep 20, 2025
6cb841a
adjust docs according to review
hoyer-a Sep 23, 2025
8381571
use _combined_contour for contour_map
hoyer-a Sep 26, 2025
7bee9cb
Docstring math formatting
mberz Oct 1, 2025
a140bee
add blank lines in examples
hoyer-a Oct 1, 2025
129c5cb
revert line indents
tluebeck Oct 2, 2025
9c7726a
bugfix files not found
tluebeck Oct 2, 2025
fc2d915
bugfix file not found
tluebeck Oct 2, 2025
1c9f748
fix ruff error
tluebeck Oct 2, 2025
9e8a1f6
Merge pull request #172 from pyfar/feature/new_sh_normalizations
mberz Oct 2, 2025
b541b0a
fix math display in special and rotations
hoyer-a Oct 2, 2025
f34001a
remove 'apply' documentation in calculate_sampling_weights
hoyer-a Oct 9, 2025
95e4c20
improce docs for eigenmikes
ahms5 Oct 6, 2025
650c983
Apply suggestions from code review
ahms5 Oct 10, 2025
e7c367c
review
ahms5 Oct 10, 2025
9100e81
add initial version of the spherical harmonic definition class
mberz Aug 8, 2025
39de21f
let SphericalHarmonics class use base class SphericalHarmonicDefinition
mberz Aug 22, 2025
2be23ae
pre-init properties
mberz Sep 16, 2025
cedf1a5
Move n_max dependent checks out of Definition setter back into the Sp…
mberz Sep 16, 2025
14ea93c
Update tests for SphericalHarmonicDefintion and SphericalHarmonics
mberz Sep 16, 2025
760ac1c
simplify CS check
mberz Sep 16, 2025
942ce62
Change order in which the properties are initialized
mberz Sep 16, 2025
3498557
Add additional tests
mberz Sep 16, 2025
6e2e0cf
Add Definition to init
mberz Sep 17, 2025
df1db32
revise based on review
mberz Sep 18, 2025
9bb1068
revise based on review
mberz Sep 22, 2025
5c3f9ab
Adapt SH Definition class to new normalization conventions
mberz Oct 9, 2025
c7b380a
remove unused import
mberz Oct 9, 2025
79d3aad
move n_max to the SphericalHarmonicDefinition class
mberz Oct 9, 2025
73addf3
adapt test to n_max being property of SphericalHarmonicDefinition
mberz Oct 9, 2025
1fa3538
update docstring for SH definition
mberz Oct 9, 2025
e4b9cbb
more compact formatting
mberz Oct 9, 2025
ae344ed
add caching of old values to avoid unnecessary resets of compute attr…
mberz Oct 10, 2025
4140fcc
Use init of parent class
mberz Oct 10, 2025
1204eda
change order
mberz Oct 10, 2025
601a5db
Add order limitation notes for 'fuma' and 'maxN' conventions
mberz Oct 10, 2025
5cba8d8
Add icosahedron sampling fixture
mberz Oct 17, 2025
4f12549
introduce new on_property_change method to reset computed attributes …
mberz Oct 17, 2025
214b79e
Extend testing for recomputation of dependent properties on property …
mberz Oct 17, 2025
9a746b7
cleanup and use of fixture in spherical harmonics tests
mberz Oct 17, 2025
4349811
Add type to docstring
mberz Oct 17, 2025
6ff2099
update test docstrings
mberz Oct 17, 2025
3fc54c7
simplify logic in spherical harmonics class
mberz Oct 17, 2025
a71ec37
harmonize default value documentation
hoyer-a Oct 9, 2025
3b1e62a
adjusting formulations
hoyer-a Oct 10, 2025
3ca2898
apply review
hoyer-a Oct 14, 2025
50334a1
correct cmap documentation for cmap_encoding parameter
ahms5 Oct 10, 2025
83b1c19
Apply suggestions from code review
ahms5 Oct 10, 2025
297d9fd
Update spharpy/plot/spatial.py
ahms5 Oct 12, 2025
df31155
Apply suggestions from code review
ahms5 Oct 13, 2025
b72c4f8
Apply suggestions from code review
ahms5 Oct 13, 2025
2b36c8b
fix ruff
ahms5 Oct 16, 2025
5151b0c
refactor acn and fuma to ACN and FuMa in SphericalHarmonics and Defin…
mberz Oct 17, 2025
e7eb24a
refactor acn and fuma to ACN and FuMa in SH audio class
mberz Oct 17, 2025
2ebd42d
refactor acn and fuma to ACN and FuMa in spherical module
mberz Oct 17, 2025
6845759
fix doc for cube_equidistant
ahms5 Oct 6, 2025
c54335c
improve method name and remove flatten result
ahms5 Oct 6, 2025
16f222b
Update spharpy/samplings/samplings.py
ahms5 Oct 8, 2025
8cfafeb
fix test
ahms5 Oct 8, 2025
37b0a4c
rename function as suggested by @mberz
ahms5 Oct 8, 2025
8ee135e
remove non usefull comments
ahms5 Oct 8, 2025
053133d
rename tests
ahms5 Oct 8, 2025
abf31cd
add flatten_output parameter including tests
ahms5 Oct 10, 2025
ef0193a
fix tests
ahms5 Oct 10, 2025
4ff3c41
Apply suggestions from code review
ahms5 Oct 10, 2025
f3185b5
fix ruff and doc
ahms5 Oct 10, 2025
24ae39a
Apply suggestions from code review
ahms5 Oct 17, 2025
3c8898f
fix test
ahms5 Oct 17, 2025
3a18898
refactor hyperinterpolation sampling
ahms5 Oct 18, 2025
253d7b3
make diff in tests easier to read
ahms5 Oct 18, 2025
dc552e0
improve error tests
ahms5 Oct 18, 2025
eb66b39
Apply suggestions from code review
ahms5 Oct 20, 2025
c7e94ce
Update spharpy/samplings/samplings.py
ahms5 Oct 22, 2025
e7abe93
cleanup tests
ahms5 Oct 22, 2025
8bc69e3
separate an abstract base class for SH definitions without n_max as p…
mberz Oct 24, 2025
f984e8e
re-use init of the base class in SphericalHarmonicDefinition.__init__
mberz Nov 17, 2025
42e30f8
Extend docstring of _SphericalHarmonicBase and SphericalHarmonicDefin…
mberz Nov 19, 2025
a37de34
fix docstings
f-brinkmann Dec 4, 2025
64c494c
Merge pull request #234 from pyfar/fix/SamplingSphere_docs
f-brinkmann Dec 5, 2025
46c5277
Add SamplingSphere.from_coordinates (#235)
f-brinkmann Dec 5, 2025
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
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
command: |
pip install ".[docs]"
cd docs/
make html
make html SPHINXOPTS="-W"

test_deprecation_warnings:
parameters:
Expand Down Expand Up @@ -202,6 +202,7 @@ workflows:
requires:
- build_and_test


test_and_publish:
# Test and publish on new git version tags
# This requires its own workflow to successfully trigger the test and build
Expand Down
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,3 @@ end_of_line = crlf

[LICENSE]
insert_final_newline = false

[Makefile]
indent_style = tab
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ venv.bak/
# macOS
.DS_Store

# external data that is loaded from the web
spharpy/samplings/_eqsp/samplings_extremal*
spharpy/samplings/_eqsp/samplings_t_design*

# workaround for failing test discovery in vscode
tests/*/__init__.py
tests/private/
Expand All @@ -120,4 +124,8 @@ docs/header.rst
docs/_static/favicon.ico
docs/_static/header.rst
docs/_static/css/custom.css
docs/_static/js/custom.js
docs/resources/logos/pyfar_logos_fixed_size_spharpy.png

# ignore plot output
tests/test_plot_data/output/
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sphinx:
formats:
- pdf

# Optionally set the version of Python and requirements required to build your docs
# use pip to install dependencies
python:
install:
- method: pip
Expand Down
10 changes: 9 additions & 1 deletion docs/api_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,26 @@ For examples on how to use spharpy refer to the notebooks in the
`examples gallery`_ and the documentation on classes and modules below.


Classes
-------

.. toctree::
:maxdepth: 1

classes/spharpy.coordinates

Modules
-------

.. toctree::
:maxdepth: 1

modules/spharpy.beamforming
modules/spharpy.indexing
modules/spharpy.interpolate
modules/spharpy.plot
modules/spharpy.samplings
modules/spharpy.spatial
modules/spharpy.special
modules/spharpy.spherical
modules/spharpy.transforms

Expand Down
9 changes: 9 additions & 0 deletions docs/classes/spharpy.coordinates.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
spharpy.SamplingSphere
----------------------

.. automodule:: spharpy.classes.coordinates

.. autoclass:: spharpy.SamplingSphere
:members:
:undoc-members:
:inherited-members:
14 changes: 8 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
import shutil
import numpy as np
sys.path.insert(0, os.path.abspath('..'))

import spharpy # noqa
import spharpy # noqa: E402

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand All @@ -37,10 +36,6 @@
# package
autodoc_default_options = {'autosummary': True}

# show the code of plots that follows the command .. plot:: based on the
# package matplotlib.sphinxext.plot_directive
plot_include_source = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down Expand Up @@ -84,12 +79,19 @@
# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = False

# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = False

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False

# default language for highlighting in source code
highlight_language = "python3"

# show the code of plots that follows the command .. plot:: based on the
# package matplotlib.sphinxext.plot_directive
plot_include_source = True

# intersphinx mapping
intersphinx_mapping = {
'numpy': ('https://numpy.org/doc/stable/', None),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
spharpy.indexing
================
spharpy.special
---------------

.. automodule:: spharpy.indexing
.. automodule:: spharpy.special
:members:
:special-members: __init__
:undoc-members:
Expand Down
18 changes: 7 additions & 11 deletions examples/general_beamforming_weights.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"outputs": [],
"source": [
"import numpy as np\n",
"import pyfar as pf\n",
"import spharpy\n",
"import matplotlib.pyplot as plt\n",
"from matplotlib.collections import LineCollection\n",
Expand Down Expand Up @@ -51,7 +52,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Analytic Plane Wave"
"# Beamforming\n",
"\n",
"The directional component of a plane wave can be expanded as a Fourier series using the spherical harmonics."
]
},
{
Expand All @@ -61,17 +64,10 @@
"outputs": [],
"source": [
"N = 7\n",
"doa = spharpy.samplings.Coordinates(-1,0,0)\n",
"doa = pf.Coordinates(-1,0,0)\n",
"p_nm = spharpy.spherical.spherical_harmonic_basis_real(N, doa)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Beamforming"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -80,7 +76,7 @@
"source": [
"n_dirs = 1024\n",
"azi = np.linspace(0, 2*np.pi, n_dirs)\n",
"steering_directions = spharpy.samplings.Coordinates.from_spherical(np.ones(n_dirs), np.ones(n_dirs)*np.pi/2, azi)\n",
"steering_directions = pf.Coordinates.from_spherical_colatitude(azi, np.ones(n_dirs)*np.pi/2, 1)\n",
"Y_steering = spharpy.spherical.spherical_harmonic_basis_real(N, steering_directions)"
]
},
Expand Down Expand Up @@ -220,7 +216,7 @@
"source": [
"h_n = spharpy.beamforming.normalize_beamforming_weights(\n",
" hann(2*(N+1)+1)[N+1:-1], N)\n",
"h_nm = spharpy.indexing.sph_identity_matrix(N).T @ h_n\n",
"h_nm = spharpy.spherical.sph_identity_matrix(N).T @ h_n\n",
"hanning = np.squeeze(Y_steering @ np.diag(h_nm) @ p_nm.T)"
]
},
Expand Down
14 changes: 7 additions & 7 deletions examples/plane_wave_decomposition.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"outputs": [],
"source": [
"import spharpy\n",
"from spharpy.samplings import Coordinates\n",
"from pyfar import Coordinates\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from matplotlib.colorbar import Colorbar\n",
Expand Down Expand Up @@ -66,7 +66,7 @@
"plt.figure(figsize=(16, 4))\n",
"ax = plt.subplot(1, 2, 1)\n",
"n_max = 4\n",
"mask = spharpy.spherical.nm2acn(np.arange(0, n_max+1), np.zeros(n_max+1))\n",
"mask = spharpy.spherical.nm_to_acn(np.arange(0, n_max+1), np.zeros(n_max+1))\n",
"ax.plot(kr, 10*np.log10(np.abs(np.diagonal(B_open, axis1=1, axis2=2)[:, mask])))\n",
"plt.grid(True)\n",
"ax.set_ylabel('Magnitude in dB')\n",
Expand All @@ -75,7 +75,7 @@
"ax.set_title('Open Sphere')\n",
"ax.set_ylim((-20, 15))\n",
"ax = plt.subplot(1, 2, 2)\n",
"mask = spharpy.spherical.nm2acn(np.arange(0, n_max+1), np.zeros(n_max+1))\n",
"mask = spharpy.spherical.nm_to_acn(np.arange(0, n_max+1), np.zeros(n_max+1))\n",
"ax.plot(kr, 10*np.log10(np.abs(np.diagonal(B_rigid, axis1=1, axis2=2)[:, mask])))\n",
"plt.grid(True)\n",
"ax.set_ylabel('Magnitude in dB')\n",
Expand All @@ -100,7 +100,7 @@
"\n",
"p_nm = B @ plane_wave_density.T.conj()\n",
"\n",
"sphere = spharpy.samplings.hyperinterpolation(30)\n",
"sphere = spharpy.samplings.hyperinterpolation(n_max=30)\n",
"Y_sphere = spharpy.spherical.spherical_harmonic_basis(n_max, sphere)\n",
"\n",
"p_sphere = np.squeeze(Y_sphere @ p_nm)"
Expand Down Expand Up @@ -130,7 +130,7 @@
"\n",
"$$ \\mathbf{a}(k) = \\frac{4\\pi}{(N+1)^2}\\mathbf{Y_s}^H \\mathbf{B}^{-1} \\mathbf{p_{nm}}$$\n",
"\n",
"with the steering matrix $ \\mathbf{Y_s} $"
"with the steering matrix $\\mathbf{Y_s}$"
]
},
{
Expand All @@ -151,7 +151,7 @@
"outputs": [],
"source": [
"plt.figure(figsize=(10, 4))\n",
"spharpy.plot.contour(steering_directions, np.abs(plane_wave_density))"
"spharpy.plot.contour_map(steering_directions, np.abs(plane_wave_density), projection='mollweide')"
]
}
],
Expand All @@ -174,7 +174,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.10"
"version": "3.9.16"
}
},
"nbformat": 4,
Expand Down
14 changes: 7 additions & 7 deletions examples/spherical_harmonics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"outputs": [],
"source": [
"import spharpy\n",
"from spharpy.samplings import Coordinates\n",
"from pyfar import Coordinates\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import matplotlib as mpl\n",
Expand All @@ -24,7 +24,7 @@
" fig = plt.figure(figsize=(12, 8))\n",
" gs = plt.GridSpec(4, 5, height_ratios=[1, 1, 1, 0.1], width_ratios=[1, 1, 1, 1, 1])\n",
" for acn in range((n_max+1)**2):\n",
" n, m = spharpy.spherical.acn2nm(acn)\n",
" n, m = spharpy.spherical.acn_to_nm(acn)\n",
" idx_m = int(np.floor(n_max/2+1)) + m\n",
" ax = plt.subplot(gs[n, idx_m], projection='3d')\n",
" balloon = spharpy.plot.balloon_wireframe(sampling, Y[:, acn], phase=True, colorbar=False, ax=ax)\n",
Expand Down Expand Up @@ -76,7 +76,7 @@
"metadata": {},
"outputs": [],
"source": [
"sampling = spharpy.samplings.equalarea(25, condition_num=np.inf)\n",
"sampling = spharpy.samplings.equal_area(25, condition_num=np.inf)\n",
"plt.figure(figsize=(7, 7))\n",
"spharpy.plot.scatter(sampling)"
]
Expand Down Expand Up @@ -188,7 +188,7 @@
"outputs": [],
"source": [
"n_points = 128\n",
"circle = Coordinates.from_spherical(np.ones(n_points), np.full(n_points, np.pi/2), np.linspace(0, 2*np.pi, n_points))\n",
"circle = Coordinates.from_spherical_colatitude(np.linspace(0, 2*np.pi, n_points), np.pi/2, 1)\n",
"Y_real_circle = spharpy.spherical.spherical_harmonic_basis_real(n_max, circle)"
]
},
Expand Down Expand Up @@ -277,7 +277,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Gradient of the Spherical Harmonics\n",
"## Gradient of the Spherical Harmonics\n",
"\n",
"The gradient of the spherical harmonics on the unit sphere can be written as,\n",
"\n",
Expand All @@ -290,7 +290,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Gradient of the Complex-Valued Spherical Harmonics"
"### Gradient of the Complex-Valued Spherical Harmonics"
]
},
{
Expand Down Expand Up @@ -325,7 +325,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Gradient of the Real-Valued Spherical Harmonics"
"### Gradient of the Real-Valued Spherical Harmonics"
]
},
{
Expand Down
27 changes: 14 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ classifiers = [
]
dependencies = [
'numpy>=1.22',
'scipy',
'scipy>=1.15',
'urllib3',
'matplotlib>=3.10.3',
'pyfar<0.8.0',
'pyfar>=0.7.3,<0.8.0',
'pytz',
]

Expand Down Expand Up @@ -80,6 +80,7 @@ find = {} # Scan the project directory with the default parameters
exclude = [
".git",
"docs",
"examples",
]
line-length = 79
lint.ignore = [
Expand All @@ -93,23 +94,23 @@ lint.ignore = [
"PT018", # Assertion should be broken down into multiple parts
"PT019", # Fixture `_` without value is injected as parameter
# add more ignores, to match flake8 rules
"D417",
#"D417",
]
lint.select = [
# "B", # bugbear extension
# "ARG", # Remove unused function/method arguments
"ARG", # Remove unused function/method arguments
"B", # bugbear extension
"C4", # Check for common security issues
# "E", # PEP8 errors
# "F", # Pyflakes
# "W", # PEP8 warnings
# "D", # Docstring guidelines
"E", # PEP8 errors
"F", # Pyflakes
"W", # PEP8 warnings
"D", # Docstring guidelines
"NPY", # Check all numpy related deprecations
"D417", # Missing argument descriptions in the docstring
# "PT", # Pytest style
# "A", # Avoid builtin function and type shadowing
# "ERA", # No commented out code
"PT", # Pytest style
"A", # Avoid builtin function and type shadowing
"ERA", # No commented out code
"NPY", # Check all numpy related deprecations
# "COM", # trailing comma rules
"COM", # trailing comma rules
"I002", # missing required import
"TID252", # Use absolute over relative imports
"FIX", # Code should not contain FIXME, TODO, etc
Expand Down
Loading