Draft
Conversation
Contributor
There was a problem hiding this comment.
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 finalizegmshreliably. - Added
Pyroomacousticstomethods-config.jsonand introduced a newexample_settings/pyroomacoustics_setting.json. - Updated the method package dependencies/config (adds
pyfarand 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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Requires #2 to be merged.