-
Notifications
You must be signed in to change notification settings - Fork 2
Feature: Scattering ISO limits #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this 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 implements ISO 17497-1:2004 scattering limits by adding two key functions for diffuse scattering calculations in acoustics. The implementation provides standardized maximum values for absorption and scattering coefficients used in reverberation room measurements.
- Adds
maximum_sample_absorption_coefficient()function that returns a constant value of 0.5 for given frequencies per ISO standards - Adds
maximum_baseplate_scattering_coefficient()function that implements Table 1 from ISO 17497-1:2004 with optional scale factor support - Creates comprehensive test suite covering input validation, data integrity, and edge cases
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
imkar/scattering/diffuse.py |
Core implementation of the two ISO limit functions with input validation and pyfar integration |
tests/test_scattering_diffuse.py |
Comprehensive test suite covering normal operation, edge cases, and error conditions |
imkar/scattering/__init__.py |
Module initialization exposing the diffuse submodule |
imkar/__init__.py |
Package-level import of the scattering module |
docs/modules/imkar.scattering.diffuse.rst |
Sphinx documentation configuration for the new module |
docs/modules/imkar.rst |
Removed old module documentation file |
docs/api_reference.rst |
Updated API reference to point to the new diffuse module |
Comments suppressed due to low confidence (2)
tests/test_scattering_diffuse.py:68
- The test function name suggests it tests negative N values, but the test uses N=5 which is positive. The name should be updated to reflect what the test actually does, such as 'test_maximum_baseplate_scattering_coefficient_positive_scale_factor'.
def test_maximum_baseplate_scattering_coefficient_negative_N():
tests/test_scattering_diffuse.py:64
- The test checks TypeError for float input but doesn't test the zero case. Consider adding a test for N=0 to ensure the validation properly handles this edge case.
isd.maximum_baseplate_scattering_coefficient(N=1.5)
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just one thing.
tests/test_scattering_diffuse.py
Outdated
| with pytest.raises(TypeError, match="N must be a positive integer."): | ||
| isd.maximum_baseplate_scattering_coefficient(N=-1) | ||
|
|
||
| def test_maximum_baseplate_scattering_coefficient_negative_N(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be _positive_N?
Which issue(s) are closed by this pull request?
Closes #28
Changes proposed in this pull request:
maximum_sample_absorption_coefficient(frequencies)->FrequencyData(returns 0.5 for the given freqeunceis)maximum_baseplate_scattering_coefficient(N)->FrequencyData(the table 1)