EngD Project Pull Request#2
Merged
SilvinWillemsen merged 203 commits intochoras-org:InputOutputfrom Mar 28, 2025
Merged
Conversation
- static code check for `dev` - static & dynamic code check for `test` - see more details in *.github/workflows/* - configuration settings are: *.black* and *.flake8*
- run `pip install simulation-backend/.` to update your global lib - run `pip install openpyxl` to install the necessary library.
- patch for dac027f - `export_separate_csvs` indicates whether **also** convert results to csv files separately. Defaults to True.
- patch for dac027f
- here is an example to use it: ```python[] from app.utils.auralization import auralization_calculation signal_file_path = "Diffusion/Auralization/Frequency(english).wav" pressure_file_path = "uploads/MeasurementRoom_b1bb26b5f1ae4040800c0b2563299c0f_1_pressure.csv" wav_output_file_name = "uploads/MeasurementRoom_b1bb26b5f1ae4040800c0b2563299c0f_1.wav" sh_conv, fs, _ = auralization_calculation(signal_file_path, pressure_file_path, wav_output_file_name) import sounddevice as sd sd.play(sh_conv, fs) ```
- after the simulation is done, .zip file (for download) and _pressure.csv file (for auralization) are generated.
exports -> export patch for 8404c75
Merge `export_csv` to `auralization`
feature `export_csv` to `dev`
Merge export_csv to auralization
`pandas==2.2.3`
Update requirements.txt
- ignore `edg-acoustics` folder when code-quality checking - I don't know why our previous tests pass... Co-Authored-By: Hary Dhimas <h.d.prakoso@tue.nl>
update workflows
I add an example unit test `tests\unit\services\test_auralization_service.py` for your reference. @dichloro
TODO: implement `run_auralization` in `create_new_auralization`
This reverts commit 20946d3.
This reverts commit 9400ad1.
`dev` to `test` for the final upstream merge v1.0
`test` to `main` for the final upstream merge v1.0
isort&black&flake8
fix format
fix format
…ttings_in_json Feature/save solver settings in json
from `feature/save_solver_settings_in_json`
from `feature/save_solver_settings_in_json`
improve conversion algorithm
from `upload_obj_only`
mberz
pushed a commit
that referenced
this pull request
Apr 13, 2026
…in-backend Feature/discovery of methods in backend
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.
Maintainer Manual
This manual provides an overview of new features for maintainers—things you should know before contributing to this project.
1. Feature: Upload .obj Only
1.1. How to Enable This Function?
In
config.py, there is a classFeatureToggle(DefaultConfig)with a commented-out attribute:enable_geo_conversion = True.To enable this feature, simply uncomment it.
1.2. Why Is the Default Value Set to False?
We found that using a
.geofile converted from.objproduces slightly different results compared to using the original.geofile. However, the differences are minimal. Since we currently lack the expertise to fully analyze this impact, we have left this feature disabled by default.1.3. How to extend upload?
Currently the system support
.geo,.obj, and.dxfto be able to add more method look intofactory.geometry_converter_factory. On that folder we can add other conversion method such asGltfConversion.pyand then register it in theGeometryConversionFactory.py. Then to allow file upload enable the newly supported file in BE and FE. On the BE you can do it by adding the option intoconfig.pyonALLOWED_EXTENSIONSparameter. On the FE can be done by adding it onImportModelStep1.tsxthen look for this line<Uploader disabled={importStarted} accept={'.obj,xxx'}then add it beside other file.2. Feature: User Parameter Setting
2.1. How to Create a Setting Template for a Method?
Follow these steps:
Create a Template
.jsonfile in theexample_settingsfolder, following the format ofexample_settings\de_setting.json.textbox,slider,checkbox, andradio.default(recommended) or setdefault=null(warnings in frontend).Register Your Template
app\models\data\simulation_settings.json, create an object with the following properties:name: The filename created in Step 1.label: The name displayed on the UI.description: (Optional) A brief description of this method.simulationType: The corresponding simulation name stored in the database.Add
simulationTypeto the Libraryapp\types\Task.py, addsimulationTypetoTaskType(Enum)to ensure consistency and ease of reference.simulation.taskType.value in (TaskType.DE.value, TaskType.BOTH.value):, usingTaskType.DEinstead of a hardcoded"DE"string provides better code hints and ensures global consistency if renaming is needed.Run the Update Command
flask update-settingto register the settings in the database.(Optional) Update a Setting File
.jsonfile is sufficient; no further operations are required.2.2. How to Retrieve and Use the Settings?
Settings are stored in both
develop.db -> simulations -> solverSettingsand correspondingMeasurementRoom_xxx..._x.jsonfile in fieldsimulationSettings.3. Feature: Auralization
3.1. How Does Auralization Work?
The implementation follows the process outlined by Ilaria in
Diffusion\Auralization\AuralizationFunctionFrequency.py.numpy, has been replaced withscipy, asscipyhandles multi-channel audio more efficiently.np.allclose, ensuring consistency between the original and modified versions.3.2. How to Add More Default Audio Examples for Users?
Follow these steps:
Move Your Audio File
.wavfile in theexample_audiosdirectory.Register the Example
app\models\data\audio_files.json, create an object with the following properties:name: The name displayed on the UI.filename: The filename added in Step 1.description: (Optional) A brief description of this example.fileExtension: The file type (currently only supports.wav).Run the Update Command
flask update-audioto register the new example in the database.4. Feature: Export Simulation Results
4.1. How Does Export Work?
Previously, after a simulation was completed, results (excluding impulse response) were stored in a
.jsonfile.Now, all results are also stored in a separate
.xlsxfile, as reading/writing from.xlsxis more efficient than loading a.jsonfile. The impulse response is then calculated usingauralization_calculation, and the results are stored in the.xlsxfile.As a result, the
.xlsxfile now contains three sheets:This entire process runs alongside the simulation, which means the progress bar may not immediately reflect completion. Even after the simulation appears to be finished, an additional few seconds are required to generate the final
.xlsxfile.4.2. Simulation Export API
New API implemented due to enable custom export for simulation results. The API utilizes
POSTrequest as a communication method between frontend and backend. Below is the structure and explanation of the request followed by custom export example:Structure:
{ "xlsx": ["<boolean>"], "Parameters": ["<list of string>"], "EDC": ["<list of string>"], "Auralization": ["<list of string>"], "SimulationId": ["<list of number>"] }Explanation:
xlsx– Exports all simulation results in.xlsxformat.Parameters– Exports selected parameters in.csvformat. Available options: edt, t20, t30, c80, d50, ts, spl_t0_freq.EDC– Exports selected plots in.csvformat. Available options: 125Hz, 250Hz, 500Hz, 1000Hz, 2000Hz.Auralization– Exports selected auralization data in.csvformat. Available options:.wavformat..wavformat..csvformat.SimulationId– A unique simulation ID for export.Custom export example:
{ "xlsx": ["true"], "Parameters": ["edt","t20"], "EDC": ["125Hz","250Hz"], "Auralization": ["wav","csvIR"], "SimulationId": [1] }The API backend is implemented in
app\factory\export_factory. The folder containsstrategy.pyandfactory.pyclasses which can be extendable by adding new specific export to the factory class. The purpose of the factory is to specify various export methods such as auralization, excel, parameters and plots, whereas strategy is an abstract export method.4.3. How to extend the export?
5. Flask Commands