From b7aa36df18388c2afb3acd0759a45a07ff0fd618 Mon Sep 17 00:00:00 2001 From: Anne Heimes Date: Thu, 2 Apr 2026 08:53:03 +0200 Subject: [PATCH 1/6] migrate to pyfar 0.8.0 --- mesh2scattering/input/EvaluationGrid.py | 3 ++- tests/resources/numcalc/create_example_project.py | 3 ++- tests/resources/output/create_example_project.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mesh2scattering/input/EvaluationGrid.py b/mesh2scattering/input/EvaluationGrid.py index 697f62f0..c9a01f39 100644 --- a/mesh2scattering/input/EvaluationGrid.py +++ b/mesh2scattering/input/EvaluationGrid.py @@ -29,8 +29,9 @@ class EvaluationGrid(): >>> import mesh2scattering as m2s >>> import pyfar as pf + >>> import spharpy >>> - >>> points = pf.samplings.sph_lebedev(sh_order=10) + >>> points = spharpy.sampling.lebedev(10) >>> grid = m2s.input.EvaluationGrid.from_spherical( ... points, "Lebedev_N10") """ diff --git a/tests/resources/numcalc/create_example_project.py b/tests/resources/numcalc/create_example_project.py index 58b6c162..004db5ba 100644 --- a/tests/resources/numcalc/create_example_project.py +++ b/tests/resources/numcalc/create_example_project.py @@ -3,6 +3,7 @@ import os import pyfar as pf import numpy as np +import spharpy import trimesh # %% @@ -17,7 +18,7 @@ sound_sources = m2s.input.SoundSource( pf.Coordinates(0, 0, [3, 4], weights=[1, 1]), m2s.input.SoundSourceType.POINT_SOURCE) -points = pf.samplings.sph_lebedev(sh_order=10) +points = spharpy.sampling.lebedev(10)(sh_order=10) evaluation_grid = m2s.input.EvaluationGrid.from_spherical( points, 'example_grid') diff --git a/tests/resources/output/create_example_project.py b/tests/resources/output/create_example_project.py index 181f704d..b8df0752 100644 --- a/tests/resources/output/create_example_project.py +++ b/tests/resources/output/create_example_project.py @@ -4,13 +4,14 @@ import pyfar as pf import numpy as np import trimesh +import spharpy # %% frequencies = np.array([500, 1000]) sound_sources = m2s.input.SoundSource( pf.Coordinates(0, 0, [3, 4], weights=[1, 1]), m2s.input.SoundSourceType.POINT_SOURCE) -points = pf.samplings.sph_gaussian(sh_order=63) +points = spharpy.sampling.gaussian(n_max=63) evaluation_grid = m2s.input.EvaluationGrid.from_spherical( points, 'gaussian_63') From 35f6cf9446a74f12564fd6804b676b44618835df Mon Sep 17 00:00:00 2001 From: Anne Heimes Date: Thu, 2 Apr 2026 08:55:34 +0200 Subject: [PATCH 2/6] change changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0745301f..6c31221b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## mesh2scattering -- MAINT: remove restriction to pyfar version ([#75](https://github.com/ahms5/Mesh2scattering/pulls/75)) +- MAINT: remove restriction to pyfar version ([#75](https://github.com/ahms5/Mesh2scattering/pulls/75), [#78](https://github.com/ahms5/Mesh2scattering/pulls/78)) - MAINT: move matplotlib dependency to documentation as it is not required for the main package ([#74](https://github.com/ahms5/Mesh2scattering/pulls/74)) - DOC: remove obsolete dependency ``nbsphinx_link`` and use ``nbsphinx`` directly ([#76](https://github.com/ahms5/Mesh2scattering/pulls/76), [#79](https://github.com/ahms5/Mesh2scattering/pulls/79)) From d2de5102078ec40aa8889cf850fb070608bacea9 Mon Sep 17 00:00:00 2001 From: Anne Heimes Date: Thu, 2 Apr 2026 09:05:24 +0200 Subject: [PATCH 3/6] fix spharpy use --- mesh2scattering/input/EvaluationGrid.py | 2 +- tests/resources/numcalc/create_example_project.py | 2 +- tests/resources/output/create_example_project.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mesh2scattering/input/EvaluationGrid.py b/mesh2scattering/input/EvaluationGrid.py index c9a01f39..032ee39f 100644 --- a/mesh2scattering/input/EvaluationGrid.py +++ b/mesh2scattering/input/EvaluationGrid.py @@ -31,7 +31,7 @@ class EvaluationGrid(): >>> import pyfar as pf >>> import spharpy >>> - >>> points = spharpy.sampling.lebedev(10) + >>> points = spharpy.samplings.lebedev(10) >>> grid = m2s.input.EvaluationGrid.from_spherical( ... points, "Lebedev_N10") """ diff --git a/tests/resources/numcalc/create_example_project.py b/tests/resources/numcalc/create_example_project.py index 004db5ba..b32f8f1a 100644 --- a/tests/resources/numcalc/create_example_project.py +++ b/tests/resources/numcalc/create_example_project.py @@ -18,7 +18,7 @@ sound_sources = m2s.input.SoundSource( pf.Coordinates(0, 0, [3, 4], weights=[1, 1]), m2s.input.SoundSourceType.POINT_SOURCE) -points = spharpy.sampling.lebedev(10)(sh_order=10) +points = spharpy.samplings.lebedev(10)(sh_order=10) evaluation_grid = m2s.input.EvaluationGrid.from_spherical( points, 'example_grid') diff --git a/tests/resources/output/create_example_project.py b/tests/resources/output/create_example_project.py index b8df0752..b20e089c 100644 --- a/tests/resources/output/create_example_project.py +++ b/tests/resources/output/create_example_project.py @@ -11,7 +11,7 @@ sound_sources = m2s.input.SoundSource( pf.Coordinates(0, 0, [3, 4], weights=[1, 1]), m2s.input.SoundSourceType.POINT_SOURCE) -points = spharpy.sampling.gaussian(n_max=63) +points = spharpy.samplings.gaussian(n_max=63) evaluation_grid = m2s.input.EvaluationGrid.from_spherical( points, 'gaussian_63') From cf84a7466e1935c8234ff331f91369f969831ac9 Mon Sep 17 00:00:00 2001 From: Anne Heimes Date: Thu, 2 Apr 2026 09:16:31 +0200 Subject: [PATCH 4/6] restrict spharpy version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ef38867f..ee92c0d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,7 @@ tests = [ "mesh2scattering[examples]", ] examples = [ - "spharpy", + "spharpy>1.0.0", "matplotlib", ] docs = [ From 3049a4dfaf42cdc0784d80708674dbae401423eb Mon Sep 17 00:00:00 2001 From: Anne Heimes Date: Thu, 2 Apr 2026 09:23:43 +0200 Subject: [PATCH 5/6] fix spharpy dep --- examples/demo.ipynb | 11 ++++++----- pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/demo.ipynb b/examples/demo.ipynb index b94a6b3b..d402a60f 100644 --- a/examples/demo.ipynb +++ b/examples/demo.ipynb @@ -108,7 +108,8 @@ "source": [ "receiver_radius = 50\n", "receiverPoints = spharpy.samplings.gaussian(\n", - " n_max=63, radius=receiver_radius)\n", + " n_max=63)\n", + "receiverPoints.radius = receiver_radius\n", "receiverPoints = receiverPoints[receiverPoints.colatitude < np.pi/2]\n", "receiverPoints.show()\n", "plt.show()" @@ -402,11 +403,11 @@ "output_type": "stream", "text": [ "\u001b[0m\n", - "Starting manage_numcalc with the following arguments [Apr 01 2026, 20:02:34]\n", + "Starting manage_numcalc with the following arguments [Apr 02 2026, 09:23:15]\n", "----------------------------------------------------------------------------\n", "project_path: /Users/anne/git/_pyfar/Mesh2scattering/examples/project\n", "numcalc_path: /Users/anne/git/_pyfar/Mesh2scattering/mesh2scattering/numcalc/bin/NumCalc\n", - "max_ram_load: 16.00 GB (16.00 GB detected, 3.98 GB available)\n", + "max_ram_load: 16.00 GB (16.00 GB detected, 4.57 GB available)\n", "ram_safety_factor: 1.05\n", "max_cpu_load: 90 %\n", "max_instances: 8 (8 cores detected)\n", @@ -425,9 +426,9 @@ "'reference' is already complete\n", "\n", "\u001b[0m\n", - "... waiting for the last NumCalc instances to finish (checking every second, Apr 01 2026, 20:02:34)\n", + "... waiting for the last NumCalc instances to finish (checking every second, Apr 02 2026, 09:23:15)\n", "\u001b[0m\n", - "All NumCalc projects finished at Apr 01 2026, 20:02:34\n" + "All NumCalc projects finished at Apr 02 2026, 09:23:15\n" ] } ], diff --git a/pyproject.toml b/pyproject.toml index ee92c0d8..424fa1a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,7 @@ tests = [ "mesh2scattering[examples]", ] examples = [ - "spharpy>1.0.0", + "spharpy>=1.0.0", "matplotlib", ] docs = [ From ef10fe1538547818620e06704ba80f7a425c39a9 Mon Sep 17 00:00:00 2001 From: Anne Heimes Date: Thu, 2 Apr 2026 09:31:18 +0200 Subject: [PATCH 6/6] fix notebook --- examples/demo.ipynb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/examples/demo.ipynb b/examples/demo.ipynb index d402a60f..86576611 100644 --- a/examples/demo.ipynb +++ b/examples/demo.ipynb @@ -108,8 +108,7 @@ "source": [ "receiver_radius = 50\n", "receiverPoints = spharpy.samplings.gaussian(\n", - " n_max=63)\n", - "receiverPoints.radius = receiver_radius\n", + " n_max=63, radius=receiver_radius)\n", "receiverPoints = receiverPoints[receiverPoints.colatitude < np.pi/2]\n", "receiverPoints.show()\n", "plt.show()" @@ -403,11 +402,11 @@ "output_type": "stream", "text": [ "\u001b[0m\n", - "Starting manage_numcalc with the following arguments [Apr 02 2026, 09:23:15]\n", + "Starting manage_numcalc with the following arguments [Apr 02 2026, 09:31:09]\n", "----------------------------------------------------------------------------\n", "project_path: /Users/anne/git/_pyfar/Mesh2scattering/examples/project\n", "numcalc_path: /Users/anne/git/_pyfar/Mesh2scattering/mesh2scattering/numcalc/bin/NumCalc\n", - "max_ram_load: 16.00 GB (16.00 GB detected, 4.57 GB available)\n", + "max_ram_load: 16.00 GB (16.00 GB detected, 4.52 GB available)\n", "ram_safety_factor: 1.05\n", "max_cpu_load: 90 %\n", "max_instances: 8 (8 cores detected)\n", @@ -426,9 +425,9 @@ "'reference' is already complete\n", "\n", "\u001b[0m\n", - "... waiting for the last NumCalc instances to finish (checking every second, Apr 02 2026, 09:23:15)\n", + "... waiting for the last NumCalc instances to finish (checking every second, Apr 02 2026, 09:31:09)\n", "\u001b[0m\n", - "All NumCalc projects finished at Apr 02 2026, 09:23:15\n" + "All NumCalc projects finished at Apr 02 2026, 09:31:09\n" ] } ],