Skip to content

Enhancement/finalize pyroomacoustics#4

Draft
mberz wants to merge 6 commits intodevelopfrom
enhancement/finalize_pyroomacoustics
Draft

Enhancement/finalize pyroomacoustics#4
mberz wants to merge 6 commits intodevelopfrom
enhancement/finalize_pyroomacoustics

Conversation

@mberz
Copy link
Copy Markdown
Contributor

@mberz mberz commented May 8, 2026

Proposed Changes

  • Update the interface to work properly with the CHORAS backend
  • Add to the methods config
  • Add configuration files for the method (frontend config)

Requires #2 to be merged.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR finalizes the pyroomacoustics_method integration by aligning its input format and simulation setup with the CHORAS backend, adding the method to the global methods registry, and introducing a frontend settings schema for the method.

Changes:

  • Updated the pyroomacoustics interface to parse CHORAS-style inputs (frequencies under results[0], absorption coefficients as strings/lists) and to finalize gmsh reliably.
  • Added Pyroomacoustics to methods-config.json and introduced a new example_settings/pyroomacoustics_setting.json.
  • Updated the method package dependencies/config (adds pyfar and Ruff config).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
pyroomacoustics_method/pyroomacoustics_interface/pyroomacoustics_interface.py Adjusts geometry import, simulation setup (incl. air attenuation), and result export behavior to match expected backend flow.
pyroomacoustics_method/tests/test_input_pyroomacoustics.json Updates the example/test input structure to match the new interface expectations.
pyroomacoustics_method/pyproject.toml Adds pyfar dependency and Ruff configuration for the method package.
methods-config.json Registers Pyroomacoustics as a runnable method with settings + entry file metadata.
example_settings/pyroomacoustics_setting.json Adds frontend settings schema for Pyroomacoustics simulation settings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 217 to +221
material = pra.Material(
energy_absorption={
'description': surface_name,
'center_freqs': input_data['frequencies'],
'coeffs': input_data['absorption_coefficients'][surface_name],
'center_freqs': frequencies,
'coeffs': absorption_coeffs,
Comment on lines +370 to 373
air_absorption = bool(
extended_input_data["simulationSettings"].get("air_absorption")
)

room.octave_bands.base_freq = frequencies[0]
room.n_octave_bands = len(frequencies)

alpha, m_pyfar, _ = pf.constants.air_attenuation(
Comment on lines +409 to 421
def export_rir_to_input(
json_file_path: str | Path,
rir: list[list[np.ndarray]]
) -> None:
"""Export the computed RIRs to the input data structure.

Parameters
----------
input_data : dict
Input data as a dictionary.
json_file_path : str | Path
Path to the input JSON file.
rir : list of list of np.ndarray
Computed RIRs from pyroomacoustics.

Returns
-------
list[pra.Wall]
List of walls defining the room geometry and boundary conditions for
Comment on lines +4 to +8
{
"name": "Speed of sound",
"id": "c0",
"type": "float",
"display": "text",
Comment on lines +15 to +20
{
"name": "Air density",
"id": "rho0",
"type": "float",
"display": "text",
"min": 0.001,
@mberz mberz changed the base branch from test/implement_method_tests to develop May 10, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants