Skip to content

Make simulation-backends individual python packages#2

Merged
mberz merged 60 commits intoprep_engd_mergefrom
test/implement_method_tests
May 9, 2026
Merged

Make simulation-backends individual python packages#2
mberz merged 60 commits intoprep_engd_mergefrom
test/implement_method_tests

Conversation

@mberz
Copy link
Copy Markdown
Contributor

@mberz mberz commented Apr 23, 2026

Proposed Changes

This pull request refactors the simulation method interfaces into Python packages and introduces minimal tests for the each method.
This simplifies dependency management for execution/testing and allows for simplified specification of package configurations, licenses, etc.

Packaging

  • Created a pyproject.toml file for each package, specifying dependencies, optional dependencies, and entry points for CLI usage (de_interface:main). This replaces the previous requirements.txt approach.
  • Updated the Dockerfile to install the package using pip and set the working directory, improving build reproducibility and caching.

Refactoring and Organization

  • Refactored the method interface into a package structure, splitting logic into DEinterface.py, definition.py (with an abstract base class), and CLI entry points (__cli__.py, __main__.py, __init__.py).
  • Moved the CLI logic and result-saving logic out of the main module for better separation

Testing

  • Added new GitHub Actions workflows for interface and method-specific tests
  • Moved fixtures for temp file generation to conftest.py

Cleanup

  • Removed the legacy CI workflow (ci.yml) and the old requirements.txt, as these are superseded by the new package and workflows.

Code Quality and Style

  • Improved code formatting, type annotations, and docstrings throughout the codebase

Method Specific Changes

acousticDE

  • Updated to install from PyPI (This removes the hacky implementation of the cancel functionality which is no longer required, since the Docker container is terminated upon canceling through the UI)

Note: The DeepONet method is not implemented yet.

Related

closes #1

mberz added 30 commits April 20, 2026 12:09
- Move fixture definitions to conftest
- Move fixture tests to test_fixtures.py
version for edg-acoustics does not support Python 3.14
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

Copilot reviewed 51 out of 52 changed files in this pull request and generated 8 comments.

Comments suppressed due to low confidence (1)

de_method/de_interface/DEinterface.py:29

  • DEMethod.run_simulation introduces an optional json_file_path parameter, but the abstract base class defines run_simulation(self) with no parameters. Keeping consistent method signatures across implementations makes the interface clearer; either remove the parameter and always use self.input_json_path, or update the base class contract.

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

Comment thread dg_method/tests/test_edg_acoustics.py
Comment thread pyroomacoustics_method/pyroomacoustics_interface/definition.py Outdated
Comment thread pyroomacoustics_method/pyroomacoustics_interface/definition.py
Comment thread dg_method/dg_interface/__cli__.py Outdated
Comment thread dg_method/dg_interface/__cli__.py Outdated
Comment thread dg_method/dg_interface/definition.py
Comment thread de_method/de_interface/__cli__.py
Comment thread de_method/de_interface/definition.py
@mberz mberz changed the title WIP: Make simulation-backends individual python packages Make simulation-backends individual python packages May 5, 2026
@mberz
Copy link
Copy Markdown
Contributor Author

mberz commented May 5, 2026

@SilvinWillemsen: This should be ready for a good old user test now, thanks! 🥳

@SilvinWillemsen
Copy link
Copy Markdown
Contributor

Hey @mberz, thanks!

When trying to run the CHORAS_BUILD.sh script I'm getting an error (see below). The branches that I test from are:
CHORAS: engd_project_2026 (9caebfa)
backend: feature/generalized_auralization (64961c2)
simulation-backend: test/implement_method_tests (7afcf5c)

Let me know if there is anything I'm doing wrong!

------                                                                                                                              
 > [dg-method 5/6] RUN pip install --no-cache-dir /app/dg_method:                                                                   
1.622 Processing ./dg_method                                                                                                        
1.627   Installing build dependencies: started                                                                                      
36.55   Installing build dependencies: finished with status 'error'                                                                 
36.56   error: subprocess-exited-with-error                                                                                         
36.56                                                                                                                               
36.56   × pip subprocess to install build dependencies did not run successfully.                                                    
36.56   │ exit code: 1
36.56   ╰─> [2 lines of output]
36.56       ERROR: Could not find a version that satisfies the requirement setuptools>=61.0 (from versions: none)
36.56       ERROR: No matching distribution found for setuptools>=61.0
36.56       [end of output]
36.56   
36.56   note: This error originates from a subprocess, and is likely not a problem with pip.
36.56 error: subprocess-exited-with-error
36.56 
36.56 × pip subprocess to install build dependencies did not run successfully.
36.56 │ exit code: 1
36.56 ╰─> See above for output.
36.56 
36.56 note: This error originates from a subprocess, and is likely not a problem with pip.
------
Dockerfile:18

--------------------

  16 |     

  17 |     # Install the method package

  18 | >>> RUN pip install --no-cache-dir /app/dg_method

  19 |     

  20 |     WORKDIR /app/dg_method

--------------------

target dg-method: failed to solve: process "/bin/sh -c pip install --no-cache-dir /app/dg_method" did not complete successfully: exit code: 1



View build details: docker-desktop://dashboard/build/default/default/mhvrtywdroea7bn39ra3ldawi

1 similar comment
@SilvinWillemsen
Copy link
Copy Markdown
Contributor

Hey @mberz, thanks!

When trying to run the CHORAS_BUILD.sh script I'm getting an error (see below). The branches that I test from are:
CHORAS: engd_project_2026 (9caebfa)
backend: feature/generalized_auralization (64961c2)
simulation-backend: test/implement_method_tests (7afcf5c)

Let me know if there is anything I'm doing wrong!

------                                                                                                                              
 > [dg-method 5/6] RUN pip install --no-cache-dir /app/dg_method:                                                                   
1.622 Processing ./dg_method                                                                                                        
1.627   Installing build dependencies: started                                                                                      
36.55   Installing build dependencies: finished with status 'error'                                                                 
36.56   error: subprocess-exited-with-error                                                                                         
36.56                                                                                                                               
36.56   × pip subprocess to install build dependencies did not run successfully.                                                    
36.56   │ exit code: 1
36.56   ╰─> [2 lines of output]
36.56       ERROR: Could not find a version that satisfies the requirement setuptools>=61.0 (from versions: none)
36.56       ERROR: No matching distribution found for setuptools>=61.0
36.56       [end of output]
36.56   
36.56   note: This error originates from a subprocess, and is likely not a problem with pip.
36.56 error: subprocess-exited-with-error
36.56 
36.56 × pip subprocess to install build dependencies did not run successfully.
36.56 │ exit code: 1
36.56 ╰─> See above for output.
36.56 
36.56 note: This error originates from a subprocess, and is likely not a problem with pip.
------
Dockerfile:18

--------------------

  16 |     

  17 |     # Install the method package

  18 | >>> RUN pip install --no-cache-dir /app/dg_method

  19 |     

  20 |     WORKDIR /app/dg_method

--------------------

target dg-method: failed to solve: process "/bin/sh -c pip install --no-cache-dir /app/dg_method" did not complete successfully: exit code: 1



View build details: docker-desktop://dashboard/build/default/default/mhvrtywdroea7bn39ra3ldawi

@mberz
Copy link
Copy Markdown
Contributor Author

mberz commented May 6, 2026

Can you confirm if you're building a ARM or x86_64 container?

@SilvinWillemsen
Copy link
Copy Markdown
Contributor

Hi @mberz, I'm simply running the CHORAS_BUILD.sh script that references the docker-compose file. All seems to be set to linux/amd64

@mberz
Copy link
Copy Markdown
Contributor Author

mberz commented May 6, 2026

Hey, I could not reproduce the issue you are facing, so I created build actions which build the Docker containers for all methods. As far as I see they are all passing the build. So I have no clue what's causing the issue.

@mberz mberz merged commit 471ddb7 into prep_engd_merge May 9, 2026
14 checks passed
@github-project-automation github-project-automation Bot moved this from Require review to Done in CHORAS planning May 9, 2026
@SilvinWillemsen
Copy link
Copy Markdown
Contributor

For future reference, the issue I was experiencing was due to poor internet connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Re-introduce tests for backend methods

3 participants