Remove the pre-3.2 module paths, as 3.2 announced - #482
Conversation
The flat module paths that the modularization grouped into domain subpackages were deprecated in 3.2 with 4.0 named as their removal, and phonometry.loudness since 3.1. They are gone, so _compat carries one table and the alias machinery drops the per-entry wording overrides that only the 3.1 entries needed. The flat API is untouched: from phonometry import leq reads the same. What the audit found on the way out is fixed too: fifteen docstring cross-references and one test import still named a path that only the table kept alive, and the documentation generator no longer has to alias the flat names.
|
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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (19)
📝 WalkthroughWalkthroughThe PR removes pre-3.2 flat module compatibility paths, retains 4.0 taxonomy aliases, simplifies API cross-reference generation, updates alias tests, and corrects migration documentation and relocated API references. ChangesCompatibility cleanup
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 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 GuideRemove the pre-3.2 flat module-path alias generation and its associated shims, tests, and documentation, while keeping the flat top-level API intact and updating references to point at canonical 4.0 layout modules only. Flow diagram for deprecated module path resolution after removing pre-3_2 aliasesflowchart TD
UserImport["import phonometry.<module>"]
CheckAlias{"<module> in _MOVED_4X?"}
CheckExists{"<module> exists in package?"}
UserImport --> CheckAlias
CheckAlias -- Yes --> ShimModule["_namespace_shim exposes relocated module"]
ShimModule --> Warn["_warn_renamed issues deprecation warning"]
Warn --> Canonical["canonical module object returned"]
CheckAlias -- No --> CheckExists
CheckExists -- Yes --> CanonicalDirect["normal import succeeds (canonical path)"]
CheckExists -- No --> Error["ModuleNotFoundError raised (removed pre_3_2 flat paths)"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@tests/test_deprecated_aliases.py`:
- Around line 672-674: Add a negative test in tests/test_deprecated_aliases.py
that attempts to import the removed pre-3.2 module paths, including
phonometry.levels, phonometry.room_ir, phonometry.building.insulation, and
phonometry.underwater.marine_mammal_audiograms, and asserts each raises
ModuleNotFoundError. Keep the existing _MOVED_4X alias coverage 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: 7c95297b-893f-4747-a7d3-b07d00e61e0e
📒 Files selected for processing (30)
CHANGELOG.mddocs/api-reference.mdllms-full.txtscripts/generate_api_docs.pysite/src/content/docs/reference/api/aeroacoustics/atmospheric-absorption.mdsite/src/content/docs/reference/api/electroacoustics/swept-sine.mdsite/src/content/docs/reference/api/environment/air-absorption.mdsite/src/content/docs/reference/api/environment/outdoor-propagation.mdsite/src/content/docs/reference/api/materials/road-absorption.mdsite/src/content/docs/reference/api/rooms/acoustics.mdsite/src/content/docs/reference/api/rooms/image-source.mdsite/src/content/docs/reference/api/rooms/reverberation-prediction.mdsite/src/content/docs/reference/api/signals/inversion.mdsite/src/content/docs/reference/api/signals/phase.mdsrc/phonometry/_compat.pysrc/phonometry/aircraft/atmospheric_absorption.pysrc/phonometry/building/measurement/uncertainty.pysrc/phonometry/environment/propagation/air_absorption.pysrc/phonometry/environment/propagation/outdoor_propagation.pysrc/phonometry/environment/sources/wind_turbine.pysrc/phonometry/hearing/occupational_exposure.pysrc/phonometry/materials/absorbers/rating.pysrc/phonometry/materials/diffusers/scattering_diffusion.pysrc/phonometry/materials/surfaces/road_absorption.pysrc/phonometry/psychoacoustics/quality/annoyance.pysrc/phonometry/room/image_source.pysrc/phonometry/room/reverberation_prediction.pysrc/phonometry/speech/sii.pytests/test_deprecated_aliases.pytests/test_utils.py
💤 Files with no reviewable changes (1)
- scripts/generate_api_docs.py
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #482 +/- ##
==========================================
- Coverage 96.99% 96.99% -0.01%
==========================================
Files 273 273
Lines 38664 38661 -3
==========================================
- Hits 37503 37500 -3
Misses 1161 1161 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 — 48048 tests, 0 failures (✅ all green)
Conformance harness: |
The comment that introduces _compat still named the generation this release removes, the example in the install loop was itself a removed path, and the count was rounded the wrong way: the table held eighty-two paths. The pickle note says which pickles still resolve, an alias that never existed in either table now names the module it meant, and the alias shim keeps a test for the attribute it refuses.
|
|
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 |



The flat module paths that the 3.2 modularization grouped into domain
subpackages were deprecated then, with 4.0 named as their removal, and
phonometry.loudnesshas carried that notice since 3.1. They are gone:phonometry.levels,phonometry.insulation,phonometry.room_irand theirninety-odd siblings raise
ModuleNotFoundErrornow.The flat API they were reached through is untouched.
from phonometry import leqreads exactly as it always has, and so does every other name inphonometry.__all__; only the module paths are gone. The 4.0 taxonomy aliasesare not affected either, and stay until 5.0 as announced.
With one generation left,
_compat.pykeeps one table,_GENERATIONSone row,and the alias machinery drops the per-entry wording overrides that only the 3.1
deprecations needed.
The audit that went with the removal found the paths that were only alive
because the table kept them so: fifteen docstring cross-references, one real
test import (
phonometry.utils), and two runtime deprecation messages thattold the user to use a flat path. All now name the canonical module. The
documentation generator loses the block that aliased flat names to current
pages, with no change to the cross-reference counts; two references resolve to
a function anchor instead of a module page, which is where they were pointing
all along.
Summary by Sourcery
Remove the deprecated pre-3.2 flat module-path aliases and their supporting compatibility machinery, while keeping the flat top-level API intact.
Bug Fixes:
Enhancements:
Documentation:
Tests:
Summary by CodeRabbit
Bug Fixes
ModuleNotFoundError.Documentation