Give underwater three families - #480
Conversation
The domain was thirteen flat modules covering the three questions an underwater problem asks, so it now answers them in that order: sources for what makes the sound, propagation for how it gets there, bioacoustics for who hears it. The ISO 18405 quantities and the sonar equation stay at the root, because all three families are written in their terms. The IEC 61043 intensity-instrument class check moves with them, from metrology to emission, next to the intensity chain it verifies. That was the one API section reaching into a second package to stay coherent. The namespace is untouched: the package exports the same 82 names and the ten old module paths keep working until 5.0. The path that was the propagation module is now the family package, which exports what the module did.
|
You've reached the fair usage limit for the Bito Code Review Agent trial. Upgrade to a paid plan or contact support@bito.in for assistance. Learn more |
|
Warning Review limit reached
Next review available in: 21 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
📝 WalkthroughWalkthroughThe pull request reorganizes underwater APIs into ChangesPackage and compatibility reorganization
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's GuideRestructures the underwater domain into three subpackages (sources, propagation, bioacoustics) while preserving the public namespace, and relocates the IEC 61043 intensity-compliance API and plotting from metrology to emission; updates imports, compat aliases, tests, and documentation accordingly. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #480 +/- ##
=======================================
Coverage 96.99% 96.99%
=======================================
Files 270 273 +3
Lines 38604 38617 +13
=======================================
+ Hits 37445 37458 +13
Misses 1159 1159 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
docs/ERRATA.md (1)
1092-1092: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winUpdate the stale test-file links. Both ERRATA pages still point to the old test paths after the module move.
docs/ERRATA.md#L1092: update../tests/metrology/test_intensity_compliance.pyto../tests/emission/test_intensity_compliance.py.docs/ERRATA.md#L2079: update../tests/underwater/test_weston_regimes.pyto../tests/underwater/propagation/test_weston_regimes.py.site/src/content/docs/es/reference/errata.md#L1127: update the blob path totests/emission/test_intensity_compliance.py.site/src/content/docs/es/reference/errata.md#L2114: update the blob path totests/underwater/propagation/test_weston_regimes.py.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/ERRATA.md` at line 1092, Update the stale test-file links in docs/ERRATA.md at lines 1092 and 2079, and site/src/content/docs/es/reference/errata.md at lines 1127 and 2114, replacing the old paths with the corresponding emission and underwater/propagation paths specified in the review.site/src/content/docs/reference/errata.md (1)
1114-1118: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winUpdate the intensity compliance test links to migrated paths.
site/src/content/docs/reference/errata.mdstill linksverify_intensity_classand its regression tests attests/metrology/test_intensity_compliance.py. Update these totests/emission/test_intensity_compliance.py.- The same stale
tests/metrology/test_intensity_compliance.pylink also appears insite/src/content/docs/es/reference/errata.md; update that link too.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@site/src/content/docs/reference/errata.md` around lines 1114 - 1118, Update the intensity compliance regression-test links in the errata documentation, including the link in the current English entry and the corresponding link in the Spanish entry, from the stale tests/metrology/test_intensity_compliance.py path to tests/emission/test_intensity_compliance.py; leave the verify_intensity_class source link unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@site/src/content/docs/guides/underwater-acoustics.mdx`:
- Line 253: Update the API reference link in the underwater acoustics guide to
use the canonical `underwater.sonar_equation` symbol and
`/underwater/sonar-equation/` URL, while preserving the existing pile-driving
and ship-radiated-noise links.
In `@site/src/content/docs/reference/errata.md`:
- Line 2131: Update the link text in the errata entries to match the target
module filename, replacing marine_mammal_weighting.py with weighting.py for both
occurrences while preserving the existing links and surrounding content.
---
Outside diff comments:
In `@docs/ERRATA.md`:
- Line 1092: Update the stale test-file links in docs/ERRATA.md at lines 1092
and 2079, and site/src/content/docs/es/reference/errata.md at lines 1127 and
2114, replacing the old paths with the corresponding emission and
underwater/propagation paths specified in the review.
In `@site/src/content/docs/reference/errata.md`:
- Around line 1114-1118: Update the intensity compliance regression-test links
in the errata documentation, including the link in the current English entry and
the corresponding link in the Spanish entry, from the stale
tests/metrology/test_intensity_compliance.py path to
tests/emission/test_intensity_compliance.py; leave the verify_intensity_class
source link unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: ff4669d9-8466-472b-994e-891f8a2f28e4
⛔ Files ignored due to path filters (1)
site/src/generated/api-sidebar.mjsis excluded by!**/generated/**
📒 Files selected for processing (85)
CHANGELOG.mddocs/ERRATA.mddocs/api-reference.mddocs/atmospheric-refraction.mddocs/underwater-solvers.mdllms-full.txtllms.txtscripts/api_taxonomy.pyscripts/conformance_report.pyscripts/generate_api_docs.pysite/public/llms/llms-simulation.txtsite/public/llms/llms-underwater.txtsite/src/content/docs/es/guides/atmospheric-refraction.mdxsite/src/content/docs/es/guides/marine-mammal-exposure.mdxsite/src/content/docs/es/guides/underwater-acoustics.mdxsite/src/content/docs/es/guides/underwater-propagation.mdxsite/src/content/docs/es/guides/underwater-solvers.mdxsite/src/content/docs/es/reference/errata.mdsite/src/content/docs/guides/atmospheric-refraction.mdxsite/src/content/docs/guides/marine-mammal-exposure.mdxsite/src/content/docs/guides/underwater-acoustics.mdxsite/src/content/docs/guides/underwater-propagation.mdxsite/src/content/docs/guides/underwater-solvers.mdxsite/src/content/docs/reference/api/environment/refraction.mdsite/src/content/docs/reference/api/index.mdsite/src/content/docs/reference/api/power/intensity-compliance.mdsite/src/content/docs/reference/api/power/intensity.mdsite/src/content/docs/reference/api/underwater/ambient-noise.mdsite/src/content/docs/reference/api/underwater/audiograms.mdsite/src/content/docs/reference/api/underwater/closed-form.mdsite/src/content/docs/reference/api/underwater/numerical.mdsite/src/content/docs/reference/api/underwater/pile-driving-noise.mdsite/src/content/docs/reference/api/underwater/seabed-reflection.mdsite/src/content/docs/reference/api/underwater/ship-radiated-noise.mdsite/src/content/docs/reference/api/underwater/ship-traffic-noise.mdsite/src/content/docs/reference/api/underwater/sonar-equation.mdsite/src/content/docs/reference/api/underwater/sound-speed.mdsite/src/content/docs/reference/api/underwater/weighting.mdsite/src/content/docs/reference/api/underwater/weston-regimes.mdsite/src/content/docs/reference/errata.mdsrc/phonometry/__init__.pysrc/phonometry/_compat.pysrc/phonometry/_plot/emission.pysrc/phonometry/_plot/metrology.pysrc/phonometry/_plot/underwater.pysrc/phonometry/_report/iec61043.pysrc/phonometry/emission/__init__.pysrc/phonometry/emission/intensity.pysrc/phonometry/emission/intensity_compliance.pysrc/phonometry/environment/propagation/refraction.pysrc/phonometry/metrology/__init__.pysrc/phonometry/underwater/__init__.pysrc/phonometry/underwater/bioacoustics/__init__.pysrc/phonometry/underwater/bioacoustics/audiograms.pysrc/phonometry/underwater/bioacoustics/weighting.pysrc/phonometry/underwater/propagation/__init__.pysrc/phonometry/underwater/propagation/closed_form.pysrc/phonometry/underwater/propagation/numerical.pysrc/phonometry/underwater/propagation/seabed_reflection.pysrc/phonometry/underwater/propagation/sound_speed.pysrc/phonometry/underwater/propagation/weston_regimes.pysrc/phonometry/underwater/sonar_equation.pysrc/phonometry/underwater/sources/__init__.pysrc/phonometry/underwater/sources/ambient_noise.pysrc/phonometry/underwater/sources/pile_driving_noise.pysrc/phonometry/underwater/sources/ship_radiated_noise.pysrc/phonometry/underwater/sources/ship_traffic_noise.pytests/conftest.pytests/emission/test_emission_plot_i18n.pytests/emission/test_intensity_compliance.pytests/metrology/test_metrology_plot_i18n.pytests/test_deprecated_aliases.pytests/underwater/bioacoustics/test_audiograms.pytests/underwater/bioacoustics/test_weighting.pytests/underwater/propagation/test_closed_form.pytests/underwater/propagation/test_numerical.pytests/underwater/propagation/test_seabed_reflection.pytests/underwater/propagation/test_sound_speed.pytests/underwater/propagation/test_weston_regimes.pytests/underwater/sources/test_ambient_noise.pytests/underwater/sources/test_pile_driving_noise.pytests/underwater/sources/test_ship_radiated_noise.pytests/underwater/sources/test_ship_traffic_noise.pytests/underwater/test_ainslie_worked_examples.pytests/underwater/test_underwater_plot_i18n.py
💤 Files with no reviewable changes (2)
- tests/metrology/test_metrology_plot_i18n.py
- src/phonometry/_plot/metrology.py
Numerical conformance report✅ 533/533 conformance checks pass across 57 domains and 362 standards - filters class 1 - weightings within IEC 61672-1 class 1. Each row pins a standard clause to its expected normative value and the value the library computes. Every section below is collapsible and stays collapsed while all of its rows pass; a section with any failing row opens automatically. ✅ Numerical validation - filters & weightings: class showcase (IEC 61260-1 · IEC 61672-1 · ISO 7196)IEC 61260-1:2014 class per filter architecture (order 6, one-third-octave, 100 Hz-10 kHz, fs = 48 kHz). For each architecture the table shows, at its binding band, the measured relative attenuation and the class-1 limit it must clear, so the number and the range it must sit in are both visible. A positive margin means the acceptance limits are met with that much room.
Only Butterworth (the library default) and Chebyshev-II are class-compliant architectures. Chebyshev-I and elliptic trade the mask for passband ripple, and Bessel for a maximally-flat group delay (soft rolloff); they cannot satisfy the IEC 61260-1 Class 1/2 attenuation mask by construction, so they are labelled By design - this is expected, not a failure or regression. Frequency-weighting conformance (A/C: IEC 61672-1 Table 3; G: ISO 7196 A.3). The max deviation from nominal is informational (it falls at a frequency extreme where the tolerance is widest and asymmetric); compliance is judged at the binding frequency - the one with the least headroom - where the deviation, the applicable tolerance band and the headroom are shown together.
✅ Filters & weightings: 100% (10/10)
✅ Levels & dosimetry: 100% (9/9)
✅ Room & building acoustics: 100% (72/72)
✅ Room acoustics: 100% (16/16)
✅ Psychoacoustics: 100% (14/14)
✅ Speech transmission (IEC 60268-16): 100% (10/10)
✅ System measurement (Golay / Kirkeby / Mueller-Massarani): 100% (5/5)
✅ Intensity & sound power: 100% (10/10)
✅ Building prediction & uncertainty: 100% (15/15)
✅ Outdoor propagation & occupational exposure: 100% (10/10)
✅ Materials: absorption, airflow & impedance: 100% (6/6)
✅ Scattering & diffusion (ISO 17497): 100% (14/14)
✅ In-situ road absorption (ISO 13472): 100% (3/3)
✅ Precision sound power (ISO 3745 / 9614-3): 100% (4/4)
✅ Human vibration (ISO 8041 / 2631 / 5349): 100% (15/15)
✅ Speech intelligibility (ANSI S3.5-1997): 100% (24/24)
✅ Objective intelligibility (STOI / ESTOI): 100% (3/3)
✅ Impulsive-sound prominence (NT ACOU 112): 100% (2/2)
✅ Impulsive-sound prominence (ISO/PAS 1996-3): 100% (2/2)
✅ Room noise (ANSI S12.2-2019): 100% (3/3)
✅ Hearing threshold (ISO 7029 / ISO 389-7): 100% (3/3)
✅ Measurement uncertainty (GUM / Supplement 1): 100% (7/7)
✅ Noise-induced hearing loss (ISO 1999): 100% (6/6)
✅ Multiple-shock whole-body vibration (ISO 2631-5): 100% (6/6)
✅ Sound absorption in enclosed spaces (EN 12354-6): 100% (2/2)
✅ Prominent discrete tones (ECMA-418-1): 100% (2/2)
✅ Tonal audibility (ISO/PAS 20065): 100% (11/11)
✅ Psychoacoustic annoyance & fluctuation strength (Fastl & Zwicker): 100% (3/3)
✅ Electroacoustics: distortion & frequency response: 100% (20/20)
✅ Calibrated spectral analysis (Bendat & Piersol): 100% (12/12)
✅ Multiple-input coherence (Bendat & Piersol): 100% (5/5)
✅ Time-frequency analysis (Bendat & Piersol): 100% (3/3)
✅ Correlation, time delay and envelope (B&P / Knapp & Carter): 100% (7/7)
✅ Cepstrum, liftering and envelope spectrum (Havelock / B&P): 100% (3/3)
✅ Time synchronous averaging (McFadden 1987): 100% (5/5)
✅ Data qualification and Rice statistics (Bendat & Piersol): 100% (8/8)
✅ Underwater acoustics (ISO 18405/17208/18406): 100% (6/6)
✅ Underwater sound propagation (transmission loss): 100% (16/16)
✅ Underwater propagation regimes (Weston flux theory): 100% (3/3)
✅ Marine-mammal auditory weighting (NMFS / Southall): 100% (4/4)
✅ Underwater numerical propagation (modes / rays / PE): 100% (4/4)
✅ Aircraft noise (ICAO Annex 16 / IEC 61265): 100% (15/15)
✅ Rotorcraft noise (ECAC Doc 32 / NORAH2): 100% (12/12)
✅ CNOSSOS-EU road source (Directive 2002/49/EC Annex II): 100% (6/6)
✅ Wind-turbine noise (IEC 61400-11): 100% (3/3)
✅ Porous & multilayer absorbers (Mechel / Bies / Cox & D'Antonio): 100% (20/20)
✅ Slow-sound perfect absorbers (Jimenez et al. Appl. Sci. 2017): 100% (3/3)
✅ Program loudness (ITU-R BS.1770 / EBU R 128): 100% (8/8)
✅ 2D FDTD wave simulation (Attenborough & Van Renterghem 2021, Ch. 4): 100% (4/4)
✅ Swept-sine distortion & phase utilities (Farina / Novak): 100% (7/7)
✅ Spherical ground & barriers (Attenborough / Salomons / Bies): 100% (7/7)
✅ Panel & aperture sound insulation (Bies / Hopkins / Cremer): 100% (17/17)
✅ Bending-wave plate-junction transmission (Cremer / Craik / Hopkins): 100% (6/6)
✅ Atmospheric refraction (Salomons rays / GFPE): 100% (3/3)
✅ Electroacoustics: 100% (9/9)
✅ Industrial noise control: 100% (22/22)
✅ CNOSSOS-EU railway source (Directive 2002/49/EC Annex II): 100% (8/8)
Tests & coverage — 48444 tests, 0 failures (✅ all green)
Conformance harness: |
Two errata entries labelled their links with the filenames the split renamed, and the moved exposure test carried composite assertions.
Two module cross-references named the family package after the module of that name became it, so both degraded to plain code on the published pages, and the package docstring credited ISO 18405 for a loss it does not define. The metrology notice now steers to the emission namespace rather than to a module inside it, the constants the moved renderer took with it are gone from the module it left, and the migration table shows the cross-package move.
|
|
You've reached the fair usage limit for the Bito Code Review Agent trial. Upgrade to a paid plan or contact support@bito.in for assistance. Learn more |



phonometry.underwaterwas thirteen flat modules covering the three questionsan underwater problem asks, so it answers them in that order now.
underwater.sourcesis what makes the sound: ISO 17208 ship radiated noise,shipping traffic, impact pile driving, and the wind and thermal noise the sea
makes on its own.
underwater.propagationis how it gets there: closed-formtransmission loss, Weston's regimes, the numerical solvers (normal modes, rays,
parabolic equation), the seabed it reflects off and the sound speed profile it
travels through.
underwater.bioacousticsis who hears it: marine mammalaudiograms and the regulatory auditory weighting and exposure criteria built on
them. The ISO 18405 quantities and the sonar equation stay at the root, because
all three families are written in their terms.
Four modules lose a word the family now says:
ocean_ambient_noise,marine_mammal_audiograms,marine_mammal_weightingandnumerical_propagationbecomesources.ambient_noise,bioacoustics.audiograms,bioacoustics.weightingandpropagation.numerical.The module that was
underwater.propagationispropagation.closed_form, andthe name it vacated is the family package, which exports everything the module
did: that path keeps working without a notice, because a package must not be
shadowed by an alias that warns.
The IEC 61043 intensity-instrument class check moves with them, from
metrologytoemission, next to the intensity chain it verifies, and itsrenderer and its Spanish strings move to the emission plot module. That was the
one section of the API reference reaching into a second package to stay
coherent, so the taxonomy contract loses an exception.
Nothing moves in the namespace:
from phonometry import underwaterexports thesame 82 names, and the ten pre-split module paths keep resolving with the usual
notice until 5.0.
Summary by Sourcery
Restructure the underwater and emission domains into clearer families while preserving public APIs and updating documentation and tests accordingly.
New Features:
Enhancements:
Tests:
Summary by CodeRabbit
New Features
Documentation
Compatibility