diff --git a/CHANGELOG.md b/CHANGELOG.md index 628f8e9a4..b317b16c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -999,6 +999,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ### Changed +- `phonometry.vibration` has three families, by who reads them. + `vibration.structural` is the structural acoustics that feeds building + prediction: mobility (ISO 7626), plate junctions, radiation efficiency, + experimental SEA and transfer stiffness (ISO 10846). `vibration.human` is + exposure of people: ISO 2631-1 and ISO 5349 in `human.exposure`, ISO 2631-5 + in `human.multiple_shock`. `vibration.machinery` is condition monitoring, in + `machinery.diagnostics`. Three modules lose a word the package now says: + `human_vibration` is `human.exposure`, `multiple_shock_vibration` is + `human.multiple_shock` and `machine_diagnostics` is `machinery.diagnostics`. + + Nothing moves in the namespace. `from phonometry import vibration` still + exports all 112 names, because the package re-exports its families + explicitly, so no notice fires for reading a name that stayed in the domain + it always belonged to. What changed is the module path, and the nine + pre-split paths still import and delegate with the usual notice until 5.0, + including the dotted read that follows the import: registering the alias in + `sys.modules` is enough for `import phonometry.vibration.human_vibration` + and not for the `phonometry.vibration.human_vibration.daily_exposure` after + it, so the package carries the same PEP 562 hook the other splits use, with + nothing to redirect but its own modules. + + The renderers stay in one `_plot/vibration.py`. They mirror the domain, and + the domain is still vibration: splitting the translation table three ways + would have been the riskiest edit in the change for no reader's benefit. + - `phonometry.hearing` is two packages. It held two subjects that share a word and nothing else: speech intelligibility, which scores a transmission channel and is read by whoever designs a room or a public address system, diff --git a/docs/ERRATA.md b/docs/ERRATA.md index f835badc7..a7cb050f1 100644 --- a/docs/ERRATA.md +++ b/docs/ERRATA.md @@ -1809,9 +1809,9 @@ which is the check that enforces the rule; see whole 125 Hz to 2 kHz column to better than 0,7 %; with the printed (unsquared) denominator the result is not a loss factor at all. - **Library behaviour:** `point_connection_coupling_loss_factor` in - [`junction_transmission.py`](../src/phonometry/vibration/junction_transmission.py) + [`junction_transmission.py`](../src/phonometry/vibration/structural/junction_transmission.py) implements the squared form, with the printed column pinned by a regression - test ([`tests/vibration/test_junction_transmission.py`](../tests/vibration/test_junction_transmission.py)) + test ([`tests/vibration/structural/test_junction_transmission.py`](../tests/vibration/structural/test_junction_transmission.py)) and a note at the formula. - **Status:** unreported (textbook rather than a standard). @@ -1836,7 +1836,7 @@ which is the check that enforces the rule; see oracle; $\eta_{21}$ is obtained from Eq. (6.8) with the full modal densities, and a test pins the 2,292 ratio explicitly - ([`tests/vibration/test_junction_transmission.py`](../tests/vibration/test_junction_transmission.py)). + ([`tests/vibration/structural/test_junction_transmission.py`](../tests/vibration/structural/test_junction_transmission.py)). - **Status:** unreported (textbook rather than a standard). ## Norton & Karczub 2e (2003), problem 6.10 (platform area) @@ -1862,10 +1862,10 @@ which is the check that enforces the rule; see all three printed answers within 0,4 %; the cylinder's own energy and modal density come out unchanged either way. - **Library behaviour:** `power_injection_clf` in - [`experimental_sea.py`](../src/phonometry/vibration/experimental_sea.py) + [`experimental_sea.py`](../src/phonometry/vibration/structural/experimental_sea.py) implements the inversion as published; the regression test uses the free platform area and documents the discrepancy - ([`tests/vibration/test_experimental_sea.py`](../tests/vibration/test_experimental_sea.py)). + ([`tests/vibration/structural/test_experimental_sea.py`](../tests/vibration/structural/test_experimental_sea.py)). - **Status:** unreported (textbook rather than a standard). ## Norton & Karczub 2e (2003), problem 3.14 (structural loss factor) diff --git a/docs/api-reference.md b/docs/api-reference.md index 203417fe5..9c245ef1b 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -34,7 +34,7 @@ contour = aircraft.noise_contour(path, powers, distances, sel, lmax, x=gx, y=gy) | `phonometry.room` | Room acoustics (ISO 3382), impulse responses, open-plan, room-noise criteria, reverberation prediction, EN 12354-6 | | `phonometry.materials` | Absorption (ISO 354/11654), impedance tube, airflow resistance, scattering/diffusion, road absorption, dynamic stiffness | | `phonometry.building` | Sound insulation measurement and prediction (EN 12354, ISO 717/16283/10140/15186/10052/10848), structure-borne sound | -| `phonometry.vibration` | Human vibration (ISO 2631/5349/8041), multiple shocks, mobility (ISO 7626), transfer stiffness (ISO 10846) | +| `phonometry.vibration` | Three families: `structural` (mobility ISO 7626, plate junctions, radiation, experimental SEA, transfer stiffness ISO 10846), `human` (ISO 2631/5349/8041 exposure and multiple shocks) and `machinery` (fault frequencies and condition monitoring) | | `phonometry.environmental` | Rating levels, ISO 1996-2 measurement, outdoor propagation (ISO 9613), atmospheric refraction (ray tracing and the parabolic equation), wind-turbine noise, impulsive prominence | | `phonometry.aircraft` | EPNL (ICAO Annex 16), SAE ARP 5534 absorption, airport contours (ECAC Doc 29), rotorcraft (ECAC Doc 32) | | `phonometry.underwater` | ISO 18405/17208/18406 levels, propagation and Weston regimes, sound speed, sonar equation and detection range, seabed, ambient and ship-traffic noise, marine-mammal audiograms and regulatory auditory weighting, numerical solvers | diff --git a/docs/junction-transmission.md b/docs/junction-transmission.md index f5737542d..316114560 100644 --- a/docs/junction-transmission.md +++ b/docs/junction-transmission.md @@ -362,7 +362,7 @@ from phonometry import ( power_injection_clf, right_angle_transmission_coefficient, ) -from phonometry.vibration.point_mobility import plate_bending_wave_speed +from phonometry.vibration.structural.point_mobility import plate_bending_wave_speed rho, nu, young = 2700.0, 0.33, 7.1e10 # aluminium cl = math.sqrt(young / (rho * (1.0 - nu**2))) # 5432 m/s (Eq. 6.25) diff --git a/docs/panel-sound-insulation.md b/docs/panel-sound-insulation.md index bf61dc5a0..53ce60921 100644 --- a/docs/panel-sound-insulation.md +++ b/docs/panel-sound-insulation.md @@ -784,4 +784,4 @@ fig.tight_layout(); plt.show() the measured counterpart of the theoretical point mobilities. - [Porous and multilayer absorbers](porous-absorbers.md): the cavity-fill models a double wall consumes. -- API reference: [`building.panel_transmission`](https://jmrplens.github.io/phonometry/reference/api/building/panel-transmission/), [`building.masonry_cavity_wall`](https://jmrplens.github.io/phonometry/reference/api/building/masonry-cavity-wall/), [`building.aperture_transmission`](https://jmrplens.github.io/phonometry/reference/api/building/aperture-transmission/), [`vibration.radiation_efficiency`](https://jmrplens.github.io/phonometry/reference/api/vibration/radiation-efficiency/) and [`vibration.point_mobility`](https://jmrplens.github.io/phonometry/reference/api/vibration/point-mobility/). +- API reference: [`building.panel_transmission`](https://jmrplens.github.io/phonometry/reference/api/building/panel-transmission/), [`building.masonry_cavity_wall`](https://jmrplens.github.io/phonometry/reference/api/building/masonry-cavity-wall/), [`building.aperture_transmission`](https://jmrplens.github.io/phonometry/reference/api/building/aperture-transmission/), [`vibration.structural.radiation_efficiency`](https://jmrplens.github.io/phonometry/reference/api/vibration/radiation-efficiency/) and [`vibration.structural.point_mobility`](https://jmrplens.github.io/phonometry/reference/api/vibration/point-mobility/). diff --git a/llms-full.txt b/llms-full.txt index f9fa6186c..b36b30c7f 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -388,12 +388,12 @@ The generated API reference, one page per module. Fetch these only when a specif - [underwater/sonar-equation](https://jmrplens.github.io/phonometry/reference/api/underwater/sonar-equation/) - [underwater/sound-speed](https://jmrplens.github.io/phonometry/reference/api/underwater/sound-speed/) - [underwater/weston-regimes](https://jmrplens.github.io/phonometry/reference/api/underwater/weston-regimes/) +- [vibration/diagnostics](https://jmrplens.github.io/phonometry/reference/api/vibration/diagnostics/) - [vibration/experimental-sea](https://jmrplens.github.io/phonometry/reference/api/vibration/experimental-sea/) -- [vibration/human-vibration](https://jmrplens.github.io/phonometry/reference/api/vibration/human-vibration/) +- [vibration/exposure](https://jmrplens.github.io/phonometry/reference/api/vibration/exposure/) - [vibration/junction-transmission](https://jmrplens.github.io/phonometry/reference/api/vibration/junction-transmission/) -- [vibration/machine-diagnostics](https://jmrplens.github.io/phonometry/reference/api/vibration/machine-diagnostics/) - [vibration/mechanical-mobility](https://jmrplens.github.io/phonometry/reference/api/vibration/mechanical-mobility/) -- [vibration/multiple-shock-vibration](https://jmrplens.github.io/phonometry/reference/api/vibration/multiple-shock-vibration/) +- [vibration/multiple-shock](https://jmrplens.github.io/phonometry/reference/api/vibration/multiple-shock/) - [vibration/point-mobility](https://jmrplens.github.io/phonometry/reference/api/vibration/point-mobility/) - [vibration/radiation-efficiency](https://jmrplens.github.io/phonometry/reference/api/vibration/radiation-efficiency/) - [vibration/transfer-stiffness](https://jmrplens.github.io/phonometry/reference/api/vibration/transfer-stiffness/) @@ -2247,7 +2247,7 @@ contour = aircraft.noise_contour(path, powers, distances, sel, lmax, x=gx, y=gy) | `phonometry.room` | Room acoustics (ISO 3382), impulse responses, open-plan, room-noise criteria, reverberation prediction, EN 12354-6 | | `phonometry.materials` | Absorption (ISO 354/11654), impedance tube, airflow resistance, scattering/diffusion, road absorption, dynamic stiffness | | `phonometry.building` | Sound insulation measurement and prediction (EN 12354, ISO 717/16283/10140/15186/10052/10848), structure-borne sound | -| `phonometry.vibration` | Human vibration (ISO 2631/5349/8041), multiple shocks, mobility (ISO 7626), transfer stiffness (ISO 10846) | +| `phonometry.vibration` | Three families: `structural` (mobility ISO 7626, plate junctions, radiation, experimental SEA, transfer stiffness ISO 10846), `human` (ISO 2631/5349/8041 exposure and multiple shocks) and `machinery` (fault frequencies and condition monitoring) | | `phonometry.environmental` | Rating levels, ISO 1996-2 measurement, outdoor propagation (ISO 9613), atmospheric refraction (ray tracing and the parabolic equation), wind-turbine noise, impulsive prominence | | `phonometry.aircraft` | EPNL (ICAO Annex 16), SAE ARP 5534 absorption, airport contours (ECAC Doc 29), rotorcraft (ECAC Doc 32) | | `phonometry.underwater` | ISO 18405/17208/18406 levels, propagation and Weston regimes, sound speed, sonar equation and detection range, seabed, ambient and ship-traffic noise, marine-mammal audiograms and regulatory auditory weighting, numerical solvers | @@ -18491,7 +18491,7 @@ from phonometry import ( power_injection_clf, right_angle_transmission_coefficient, ) -from phonometry.vibration.point_mobility import plate_bending_wave_speed +from phonometry.vibration.structural.point_mobility import plate_bending_wave_speed rho, nu, young = 2700.0, 0.33, 7.1e10 # aluminium cl = math.sqrt(young / (rho * (1.0 - nu**2))) # 5432 m/s (Eq. 6.25) @@ -25185,7 +25185,7 @@ fig.tight_layout(); plt.show() the measured counterpart of the theoretical point mobilities. - [Porous and multilayer absorbers](https://jmrplens.github.io/phonometry/guides/porous-absorbers/): the cavity-fill models a double wall consumes. -- API reference: [`building.panel_transmission`](https://jmrplens.github.io/phonometry/reference/api/building/panel-transmission/), [`building.masonry_cavity_wall`](https://jmrplens.github.io/phonometry/reference/api/building/masonry-cavity-wall/), [`building.aperture_transmission`](https://jmrplens.github.io/phonometry/reference/api/building/aperture-transmission/), [`vibration.radiation_efficiency`](https://jmrplens.github.io/phonometry/reference/api/vibration/radiation-efficiency/) and [`vibration.point_mobility`](https://jmrplens.github.io/phonometry/reference/api/vibration/point-mobility/). +- API reference: [`building.panel_transmission`](https://jmrplens.github.io/phonometry/reference/api/building/panel-transmission/), [`building.masonry_cavity_wall`](https://jmrplens.github.io/phonometry/reference/api/building/masonry-cavity-wall/), [`building.aperture_transmission`](https://jmrplens.github.io/phonometry/reference/api/building/aperture-transmission/), [`vibration.structural.radiation_efficiency`](https://jmrplens.github.io/phonometry/reference/api/vibration/radiation-efficiency/) and [`vibration.structural.point_mobility`](https://jmrplens.github.io/phonometry/reference/api/vibration/point-mobility/). --- diff --git a/llms.txt b/llms.txt index 185a801da..24636c4fb 100644 --- a/llms.txt +++ b/llms.txt @@ -388,12 +388,12 @@ The generated API reference, one page per module. Fetch these only when a specif - [underwater/sonar-equation](https://jmrplens.github.io/phonometry/reference/api/underwater/sonar-equation/) - [underwater/sound-speed](https://jmrplens.github.io/phonometry/reference/api/underwater/sound-speed/) - [underwater/weston-regimes](https://jmrplens.github.io/phonometry/reference/api/underwater/weston-regimes/) +- [vibration/diagnostics](https://jmrplens.github.io/phonometry/reference/api/vibration/diagnostics/) - [vibration/experimental-sea](https://jmrplens.github.io/phonometry/reference/api/vibration/experimental-sea/) -- [vibration/human-vibration](https://jmrplens.github.io/phonometry/reference/api/vibration/human-vibration/) +- [vibration/exposure](https://jmrplens.github.io/phonometry/reference/api/vibration/exposure/) - [vibration/junction-transmission](https://jmrplens.github.io/phonometry/reference/api/vibration/junction-transmission/) -- [vibration/machine-diagnostics](https://jmrplens.github.io/phonometry/reference/api/vibration/machine-diagnostics/) - [vibration/mechanical-mobility](https://jmrplens.github.io/phonometry/reference/api/vibration/mechanical-mobility/) -- [vibration/multiple-shock-vibration](https://jmrplens.github.io/phonometry/reference/api/vibration/multiple-shock-vibration/) +- [vibration/multiple-shock](https://jmrplens.github.io/phonometry/reference/api/vibration/multiple-shock/) - [vibration/point-mobility](https://jmrplens.github.io/phonometry/reference/api/vibration/point-mobility/) - [vibration/radiation-efficiency](https://jmrplens.github.io/phonometry/reference/api/vibration/radiation-efficiency/) - [vibration/transfer-stiffness](https://jmrplens.github.io/phonometry/reference/api/vibration/transfer-stiffness/) diff --git a/scripts/api_taxonomy.py b/scripts/api_taxonomy.py index 995c62b6d..c30defe9b 100644 --- a/scripts/api_taxonomy.py +++ b/scripts/api_taxonomy.py @@ -202,15 +202,15 @@ class Section: label_en="Vibration and structure-borne", label_es="Vibración y ruido estructural", modules=( - "phonometry.vibration.mechanical_mobility", - "phonometry.vibration.point_mobility", - "phonometry.vibration.radiation_efficiency", - "phonometry.vibration.junction_transmission", - "phonometry.vibration.experimental_sea", - "phonometry.vibration.machine_diagnostics", - "phonometry.vibration.transfer_stiffness", - "phonometry.vibration.human_vibration", - "phonometry.vibration.multiple_shock_vibration", + "phonometry.vibration.structural.mechanical_mobility", + "phonometry.vibration.structural.point_mobility", + "phonometry.vibration.structural.radiation_efficiency", + "phonometry.vibration.structural.junction_transmission", + "phonometry.vibration.structural.experimental_sea", + "phonometry.vibration.machinery.diagnostics", + "phonometry.vibration.structural.transfer_stiffness", + "phonometry.vibration.human.exposure", + "phonometry.vibration.human.multiple_shock", ), ), Section( @@ -389,11 +389,11 @@ class Section: "phonometry.electroacoustics.sound_reinforcement", "plot_facade_elements": "phonometry.building.facade_prediction", "plot_double_wall_geometry": "phonometry.building.panel_transmission", - "plot_junction_geometry": "phonometry.vibration.junction_transmission", + "plot_junction_geometry": "phonometry.vibration.structural.junction_transmission", "plot_insitu_geometry": "phonometry.materials.road_absorption", "plot_dynamic_stiffness_rig": "phonometry.materials.dynamic_stiffness", "plot_goniometer_geometry": "phonometry.materials.scattering_diffusion", - "plot_plate_geometry": "phonometry.vibration.radiation_efficiency", + "plot_plate_geometry": "phonometry.vibration.structural.radiation_efficiency", "plot_open_plan_geometry": "phonometry.room.open_plan", "plot_pp_probe_geometry": "phonometry.emission.intensity", # Defined in underwater.acoustics, also re-exported by diff --git a/scripts/bench.py b/scripts/bench.py index 2c3978ecc..fe110bd3b 100644 --- a/scripts/bench.py +++ b/scripts/bench.py @@ -193,7 +193,7 @@ def run_ecma_tonality() -> np.ndarray: def run_vibration_weighting() -> np.ndarray: - from phonometry.vibration.human_vibration import apply_weighting + from phonometry.vibration.human.exposure import apply_weighting sig, fs = vibration_signal() out = np.asarray(apply_weighting(sig, fs, "Wd"), dtype=np.float64) diff --git a/scripts/conformance_report.py b/scripts/conformance_report.py index 9ce87e466..7f314905e 100644 --- a/scripts/conformance_report.py +++ b/scripts/conformance_report.py @@ -4837,7 +4837,7 @@ def _chk_multiple_shock_probability() -> Outcome: _MSV, "ISO 2631-5:2018 Annex C NOTE 5", "Compressive stress Sd, female example" ) def _chk_multiple_shock_female_sd() -> Outcome: - from phonometry.vibration.multiple_shock_vibration import MZ_FEMALE + from phonometry.vibration.human.multiple_shock import MZ_FEMALE sd = ph.compression_dose(ph.dose_from_peaks([40.0] * 5), mz=MZ_FEMALE) return numeric(ref.ISO2631_5_SD_FEMALE, sd, 0.01, unit="MPa", places=2) @@ -4847,7 +4847,7 @@ def _chk_multiple_shock_female_sd() -> Outcome: _MSV, "ISO 2631-5:2018 Annex C NOTE 5", "Stress variable R, female example" ) def _chk_multiple_shock_female_r() -> Outcome: - from phonometry.vibration.multiple_shock_vibration import MZ_FEMALE + from phonometry.vibration.human.multiple_shock import MZ_FEMALE sd = ph.compression_dose(ph.dose_from_peaks([40.0] * 5), mz=MZ_FEMALE) r = ph.injury_risk(sd, start_age=20, years=20, days_per_year=120, sex="female") diff --git a/scripts/generate_graphs.py b/scripts/generate_graphs.py index ac159904b..399d46b4e 100644 --- a/scripts/generate_graphs.py +++ b/scripts/generate_graphs.py @@ -10674,7 +10674,7 @@ def generate_multiple_shock(output_dir: str) -> None: injury_risk, seat_to_spine_transfer, ) - from phonometry.vibration.multiple_shock_vibration import ( + from phonometry.vibration.human.multiple_shock import ( MZ_MALE, RISK_THRESHOLDS_MALE, ) @@ -12406,7 +12406,7 @@ def generate_experimental_sea_clf(output_dir: str) -> None: power_injection_clf, right_angle_transmission_coefficient, ) - from phonometry.vibration.point_mobility import plate_bending_wave_speed + from phonometry.vibration.structural.point_mobility import plate_bending_wave_speed rho, nu, young = 2700.0, 0.33, 7.1e10 c_l = math.sqrt(young / (rho * (1.0 - nu**2))) diff --git a/scripts/generate_reports.py b/scripts/generate_reports.py index b89b95e37..955b7e561 100644 --- a/scripts/generate_reports.py +++ b/scripts/generate_reports.py @@ -1878,7 +1878,7 @@ def _multiple_shock_example() -> tuple[object, ReportMetadata, str]: standard states as the spinal response), so the fiche's numbers are the published Annex C values. """ - from phonometry.vibration.multiple_shock_vibration import ( + from phonometry.vibration.human.multiple_shock import ( MZ_MALE, RISK_THRESHOLDS_MALE, MultipleShockResult, diff --git a/site/public/llms/llms-insulation-design.txt b/site/public/llms/llms-insulation-design.txt index fb8c7ef22..f44741cfb 100644 --- a/site/public/llms/llms-insulation-design.txt +++ b/site/public/llms/llms-insulation-design.txt @@ -1572,7 +1572,7 @@ fig.tight_layout(); plt.show() the measured counterpart of the theoretical point mobilities. - [Porous and multilayer absorbers](https://jmrplens.github.io/phonometry/guides/porous-absorbers/): the cavity-fill models a double wall consumes. -- API reference: [`building.panel_transmission`](https://jmrplens.github.io/phonometry/reference/api/building/panel-transmission/), [`building.masonry_cavity_wall`](https://jmrplens.github.io/phonometry/reference/api/building/masonry-cavity-wall/), [`building.aperture_transmission`](https://jmrplens.github.io/phonometry/reference/api/building/aperture-transmission/), [`vibration.radiation_efficiency`](https://jmrplens.github.io/phonometry/reference/api/vibration/radiation-efficiency/) and [`vibration.point_mobility`](https://jmrplens.github.io/phonometry/reference/api/vibration/point-mobility/). +- API reference: [`building.panel_transmission`](https://jmrplens.github.io/phonometry/reference/api/building/panel-transmission/), [`building.masonry_cavity_wall`](https://jmrplens.github.io/phonometry/reference/api/building/masonry-cavity-wall/), [`building.aperture_transmission`](https://jmrplens.github.io/phonometry/reference/api/building/aperture-transmission/), [`vibration.structural.radiation_efficiency`](https://jmrplens.github.io/phonometry/reference/api/vibration/radiation-efficiency/) and [`vibration.structural.point_mobility`](https://jmrplens.github.io/phonometry/reference/api/vibration/point-mobility/). --- diff --git a/site/public/llms/llms-structure-borne.txt b/site/public/llms/llms-structure-borne.txt index c9c5daf15..6ee081299 100644 --- a/site/public/llms/llms-structure-borne.txt +++ b/site/public/llms/llms-structure-borne.txt @@ -1798,7 +1798,7 @@ from phonometry import ( power_injection_clf, right_angle_transmission_coefficient, ) -from phonometry.vibration.point_mobility import plate_bending_wave_speed +from phonometry.vibration.structural.point_mobility import plate_bending_wave_speed rho, nu, young = 2700.0, 0.33, 7.1e10 # aluminium cl = math.sqrt(young / (rho * (1.0 - nu**2))) # 5432 m/s (Eq. 6.25) diff --git a/site/src/content/docs/es/guides/duct-path.mdx b/site/src/content/docs/es/guides/duct-path.mdx index fd2320f9f..37c800677 100644 --- a/site/src/content/docs/es/guides/duct-path.mdx +++ b/site/src/content/docs/es/guides/duct-path.mdx @@ -779,6 +779,6 @@ calculada sencillamente no sobreviven al corte. la constante de sala que hay detrás del efecto de sala y del término reverberante del plenum. - Referencia de la API: - [`noise_control.duct_path`](/phonometry/reference/api/noise_control/duct-path/), - [`noise_control.duct_modes`](/phonometry/reference/api/noise_control/duct-modes/), - [`noise_control.hvac`](/phonometry/reference/api/noise_control/hvac/). + [`noise_control.duct_path`](/phonometry/es/reference/api/noise_control/duct-path/), + [`noise_control.duct_modes`](/phonometry/es/reference/api/noise_control/duct-modes/), + [`noise_control.hvac`](/phonometry/es/reference/api/noise_control/hvac/). diff --git a/site/src/content/docs/es/guides/human-vibration.mdx b/site/src/content/docs/es/guides/human-vibration.mdx index d3c866015..886054dc3 100644 --- a/site/src/content/docs/es/guides/human-vibration.mdx +++ b/site/src/content/docs/es/guides/human-vibration.mdx @@ -514,4 +514,4 @@ esta página no sustituyen. ## Véase también -- Referencia de la API: [`vibration.human_vibration`](/phonometry/es/reference/api/vibration/human-vibration/). +- Referencia de la API: [`vibration.human.exposure`](/phonometry/es/reference/api/vibration/exposure/). diff --git a/site/src/content/docs/es/guides/junction-transmission.mdx b/site/src/content/docs/es/guides/junction-transmission.mdx index 56ac2bfa6..6482ba538 100644 --- a/site/src/content/docs/es/guides/junction-transmission.mdx +++ b/site/src/content/docs/es/guides/junction-transmission.mdx @@ -406,7 +406,7 @@ from phonometry import ( power_injection_clf, right_angle_transmission_coefficient, ) -from phonometry.vibration.point_mobility import plate_bending_wave_speed +from phonometry.vibration.structural.point_mobility import plate_bending_wave_speed rho, nu, young = 2700.0, 0.33, 7.1e10 # aluminio cl = math.sqrt(young / (rho * (1.0 - nu**2))) # 5432 m/s (Ec. 6.25) @@ -484,4 +484,4 @@ fronteras de los subsistemas se trazaron en el sitio equivocado. edificio. - [Movilidad mecánica y la familia de FRF (ISO 7626-1)](/phonometry/es/guides/mechanical-mobility/): las movilidades de placa tras los parámetros de onda. -- Referencia de la API: [`vibration.junction_transmission`](/phonometry/es/reference/api/vibration/junction-transmission/). +- Referencia de la API: [`vibration.structural.junction_transmission`](/phonometry/es/reference/api/vibration/junction-transmission/). diff --git a/site/src/content/docs/es/guides/machine-diagnostics.mdx b/site/src/content/docs/es/guides/machine-diagnostics.mdx index 8560632e1..d6ab616d0 100644 --- a/site/src/content/docs/es/guides/machine-diagnostics.mdx +++ b/site/src/content/docs/es/guides/machine-diagnostics.mdx @@ -297,4 +297,4 @@ laterales de una barra rota y no la multiplica por el número de polos. encontrar las resonancias estructurales que excita el impacto de un defecto. - [Transmisión de onda de flexión en uniones de placas](/phonometry/es/guides/junction-transmission/): qué le ocurre a la vibración una vez sale de la máquina. -- Referencia de la API: [`vibration.machine_diagnostics`](/phonometry/es/reference/api/vibration/machine-diagnostics/). +- Referencia de la API: [`vibration.machinery.diagnostics`](/phonometry/es/reference/api/vibration/diagnostics/). diff --git a/site/src/content/docs/es/guides/marine-mammal-exposure.mdx b/site/src/content/docs/es/guides/marine-mammal-exposure.mdx index 7d10f7c3f..b5b7e537a 100644 --- a/site/src/content/docs/es/guides/marine-mammal-exposure.mdx +++ b/site/src/content/docs/es/guides/marine-mammal-exposure.mdx @@ -320,4 +320,4 @@ estático. La propagación de la fuente al receptor pertenece a - [Propagación del sonido submarino](/phonometry/es/guides/underwater-propagation/): la pérdida por transmisión y la maquinaria de cifra de mérito que convierte un criterio en una distancia. -- Referencia de API: [`underwater.marine_mammal_weighting`](/phonometry/reference/api/underwater/marine-mammal-weighting/) y [`underwater.marine_mammal_audiograms`](/phonometry/reference/api/underwater/marine-mammal-audiograms/). +- Referencia de API: [`underwater.marine_mammal_weighting`](/phonometry/es/reference/api/underwater/marine-mammal-weighting/) y [`underwater.marine_mammal_audiograms`](/phonometry/es/reference/api/underwater/marine-mammal-audiograms/). diff --git a/site/src/content/docs/es/guides/mechanical-mobility.mdx b/site/src/content/docs/es/guides/mechanical-mobility.mdx index cfc20aab6..d6ff1416b 100644 --- a/site/src/content/docs/es/guides/mechanical-mobility.mdx +++ b/site/src/content/docs/es/guides/mechanical-mobility.mdx @@ -371,4 +371,4 @@ para una matriz de FRF completa. ## Véase también -- Referencia de la API: [`vibration.mechanical_mobility`](/phonometry/es/reference/api/vibration/mechanical-mobility/). +- Referencia de la API: [`vibration.structural.mechanical_mobility`](/phonometry/es/reference/api/vibration/mechanical-mobility/). diff --git a/site/src/content/docs/es/guides/multiple-shock-vibration.mdx b/site/src/content/docs/es/guides/multiple-shock-vibration.mdx index 0e6643abf..5f00290b5 100644 --- a/site/src/content/docs/es/guides/multiple-shock-vibration.mdx +++ b/site/src/content/docs/es/guides/multiple-shock-vibration.mdx @@ -267,4 +267,4 @@ el repositorio; pulsa la vista previa para abrir el PDF. ## Véase también -- Referencia de la API: [`vibration.multiple_shock_vibration`](/phonometry/es/reference/api/vibration/multiple-shock-vibration/). +- Referencia de la API: [`vibration.human.multiple_shock`](/phonometry/es/reference/api/vibration/multiple-shock/). diff --git a/site/src/content/docs/es/guides/noise-control.mdx b/site/src/content/docs/es/guides/noise-control.mdx index 9dffc0e45..4182ce3e9 100644 --- a/site/src/content/docs/es/guides/noise-control.mdx +++ b/site/src/content/docs/es/guides/noise-control.mdx @@ -273,5 +273,5 @@ corrección interior. las formas cerradas y los anclajes resueltos con los que se validan estas implementaciones. - Referencia de la API: - [`noise_control.hvac`](/phonometry/reference/api/noise_control/hvac/) y - [`noise_control.enclosures`](/phonometry/reference/api/noise_control/enclosures/). + [`noise_control.hvac`](/phonometry/es/reference/api/noise_control/hvac/) y + [`noise_control.enclosures`](/phonometry/es/reference/api/noise_control/enclosures/). diff --git a/site/src/content/docs/es/guides/panel-sound-insulation.mdx b/site/src/content/docs/es/guides/panel-sound-insulation.mdx index 384a86252..d49a1f40d 100644 --- a/site/src/content/docs/es/guides/panel-sound-insulation.mdx +++ b/site/src/content/docs/es/guides/panel-sound-insulation.mdx @@ -914,4 +914,4 @@ cita Vigran. la contraparte medida de las movilidades puntuales teóricas. - [Absorbentes porosos y multicapa](/phonometry/es/guides/porous-absorbers/): los modelos de relleno de cámara que consume una pared doble. -- Referencia de API: [`building.panel_transmission`](/phonometry/reference/api/building/panel-transmission/), [`building.masonry_cavity_wall`](/phonometry/reference/api/building/masonry-cavity-wall/), [`building.aperture_transmission`](/phonometry/reference/api/building/aperture-transmission/), [`vibration.radiation_efficiency`](/phonometry/reference/api/vibration/radiation-efficiency/) y [`vibration.point_mobility`](/phonometry/reference/api/vibration/point-mobility/). +- Referencia de API: [`building.panel_transmission`](/phonometry/es/reference/api/building/panel-transmission/), [`building.masonry_cavity_wall`](/phonometry/es/reference/api/building/masonry-cavity-wall/), [`building.aperture_transmission`](/phonometry/es/reference/api/building/aperture-transmission/), [`vibration.structural.radiation_efficiency`](/phonometry/es/reference/api/vibration/radiation-efficiency/) y [`vibration.structural.point_mobility`](/phonometry/es/reference/api/vibration/point-mobility/). diff --git a/site/src/content/docs/es/guides/resilient-layers.mdx b/site/src/content/docs/es/guides/resilient-layers.mdx index 4c57bdd51..435477b6e 100644 --- a/site/src/content/docs/es/guides/resilient-layers.mdx +++ b/site/src/content/docs/es/guides/resilient-layers.mdx @@ -444,4 +444,4 @@ impacto pesadas (la pelota de caucho) no las cubre ninguno de estos modelos. - [Predicción del aislamiento de paneles](/phonometry/es/guides/panel-sound-insulation/): la resonancia masa-resorte-masa de una hoja doble, la contrapartida a ruido aéreo de la resonancia de la capa adicional. -- Referencia de la API: [`building.resilient_layers`](/phonometry/reference/api/building/resilient-layers/). +- Referencia de la API: [`building.resilient_layers`](/phonometry/es/reference/api/building/resilient-layers/). diff --git a/site/src/content/docs/es/guides/transfer-stiffness.mdx b/site/src/content/docs/es/guides/transfer-stiffness.mdx index 23793db33..3a0a4e9a9 100644 --- a/site/src/content/docs/es/guides/transfer-stiffness.mdx +++ b/site/src/content/docs/es/guides/transfer-stiffness.mdx @@ -297,4 +297,4 @@ código. ## Véase también -- Referencia de la API: [`vibration.transfer_stiffness`](/phonometry/es/reference/api/vibration/transfer-stiffness/) y [`vibration.mechanical_mobility`](/phonometry/es/reference/api/vibration/mechanical-mobility/). +- Referencia de la API: [`vibration.structural.transfer_stiffness`](/phonometry/es/reference/api/vibration/transfer-stiffness/) y [`vibration.structural.mechanical_mobility`](/phonometry/es/reference/api/vibration/mechanical-mobility/). diff --git a/site/src/content/docs/es/reference/errata.md b/site/src/content/docs/es/reference/errata.md index 250c5a777..bccc4530d 100644 --- a/site/src/content/docs/es/reference/errata.md +++ b/site/src/content/docs/es/reference/errata.md @@ -1844,9 +1844,9 @@ which is the check that enforces the rule; see whole 125 Hz to 2 kHz column to better than 0,7 %; with the printed (unsquared) denominator the result is not a loss factor at all. - **Library behaviour:** `point_connection_coupling_loss_factor` in - [`junction_transmission.py`](https://github.com/jmrplens/phonometry/blob/main/src/phonometry/vibration/junction_transmission.py) + [`junction_transmission.py`](https://github.com/jmrplens/phonometry/blob/main/src/phonometry/vibration/structural/junction_transmission.py) implements the squared form, with the printed column pinned by a regression - test ([`tests/vibration/test_junction_transmission.py`](https://github.com/jmrplens/phonometry/blob/main/tests/vibration/test_junction_transmission.py)) + test ([`tests/vibration/structural/test_junction_transmission.py`](https://github.com/jmrplens/phonometry/blob/main/tests/vibration/structural/test_junction_transmission.py)) and a note at the formula. - **Status:** unreported (textbook rather than a standard). @@ -1871,7 +1871,7 @@ which is the check that enforces the rule; see oracle; $\eta_{21}$ is obtained from Eq. (6.8) with the full modal densities, and a test pins the 2,292 ratio explicitly - ([`tests/vibration/test_junction_transmission.py`](https://github.com/jmrplens/phonometry/blob/main/tests/vibration/test_junction_transmission.py)). + ([`tests/vibration/structural/test_junction_transmission.py`](https://github.com/jmrplens/phonometry/blob/main/tests/vibration/structural/test_junction_transmission.py)). - **Status:** unreported (textbook rather than a standard). ## Norton & Karczub 2e (2003), problem 6.10 (platform area) @@ -1897,10 +1897,10 @@ which is the check that enforces the rule; see all three printed answers within 0,4 %; the cylinder's own energy and modal density come out unchanged either way. - **Library behaviour:** `power_injection_clf` in - [`experimental_sea.py`](https://github.com/jmrplens/phonometry/blob/main/src/phonometry/vibration/experimental_sea.py) + [`experimental_sea.py`](https://github.com/jmrplens/phonometry/blob/main/src/phonometry/vibration/structural/experimental_sea.py) implements the inversion as published; the regression test uses the free platform area and documents the discrepancy - ([`tests/vibration/test_experimental_sea.py`](https://github.com/jmrplens/phonometry/blob/main/tests/vibration/test_experimental_sea.py)). + ([`tests/vibration/structural/test_experimental_sea.py`](https://github.com/jmrplens/phonometry/blob/main/tests/vibration/structural/test_experimental_sea.py)). - **Status:** unreported (textbook rather than a standard). ## Norton & Karczub 2e (2003), problem 3.14 (structural loss factor) diff --git a/site/src/content/docs/guides/human-vibration.mdx b/site/src/content/docs/guides/human-vibration.mdx index c64baa2d1..9d943b7d8 100644 --- a/site/src/content/docs/guides/human-vibration.mdx +++ b/site/src/content/docs/guides/human-vibration.mdx @@ -498,4 +498,4 @@ this page do not substitute for. ## See also -- API reference: [`vibration.human_vibration`](/phonometry/reference/api/vibration/human-vibration/). +- API reference: [`vibration.human.exposure`](/phonometry/reference/api/vibration/exposure/). diff --git a/site/src/content/docs/guides/junction-transmission.mdx b/site/src/content/docs/guides/junction-transmission.mdx index 154d35a9b..61ee9a5ad 100644 --- a/site/src/content/docs/guides/junction-transmission.mdx +++ b/site/src/content/docs/guides/junction-transmission.mdx @@ -391,7 +391,7 @@ from phonometry import ( power_injection_clf, right_angle_transmission_coefficient, ) -from phonometry.vibration.point_mobility import plate_bending_wave_speed +from phonometry.vibration.structural.point_mobility import plate_bending_wave_speed rho, nu, young = 2700.0, 0.33, 7.1e10 # aluminium cl = math.sqrt(young / (rho * (1.0 - nu**2))) # 5432 m/s (Eq. 6.25) @@ -467,4 +467,4 @@ subsystem boundaries were drawn in the wrong place. the source power that these junction transmissions carry through a building. - [Mechanical mobility and the FRF family (ISO 7626-1)](/phonometry/guides/mechanical-mobility/): the plate mobilities behind the wave parameters. -- API reference: [`vibration.junction_transmission`](/phonometry/reference/api/vibration/junction-transmission/). +- API reference: [`vibration.structural.junction_transmission`](/phonometry/reference/api/vibration/junction-transmission/). diff --git a/site/src/content/docs/guides/machine-diagnostics.mdx b/site/src/content/docs/guides/machine-diagnostics.mdx index 2a56cc64b..26386f2c5 100644 --- a/site/src/content/docs/guides/machine-diagnostics.mdx +++ b/site/src/content/docs/guides/machine-diagnostics.mdx @@ -276,4 +276,4 @@ count. finding the structural resonances a defect impact excites. - [Bending-wave transmission at plate junctions](/phonometry/guides/junction-transmission/): what happens to the vibration once it leaves the machine. -- API reference: [`vibration.machine_diagnostics`](/phonometry/reference/api/vibration/machine-diagnostics/). +- API reference: [`vibration.machinery.diagnostics`](/phonometry/reference/api/vibration/diagnostics/). diff --git a/site/src/content/docs/guides/mechanical-mobility.mdx b/site/src/content/docs/guides/mechanical-mobility.mdx index b9ecd0a15..d4ee1c974 100644 --- a/site/src/content/docs/guides/mechanical-mobility.mdx +++ b/site/src/content/docs/guides/mechanical-mobility.mdx @@ -359,4 +359,4 @@ single-path use but not for a full FRF matrix. ## See also -- API reference: [`vibration.mechanical_mobility`](/phonometry/reference/api/vibration/mechanical-mobility/). +- API reference: [`vibration.structural.mechanical_mobility`](/phonometry/reference/api/vibration/mechanical-mobility/). diff --git a/site/src/content/docs/guides/multiple-shock-vibration.mdx b/site/src/content/docs/guides/multiple-shock-vibration.mdx index 10512790c..471ff7da6 100644 --- a/site/src/content/docs/guides/multiple-shock-vibration.mdx +++ b/site/src/content/docs/guides/multiple-shock-vibration.mdx @@ -255,4 +255,4 @@ repository; click the preview to open the PDF. ## See also -- API reference: [`vibration.multiple_shock_vibration`](/phonometry/reference/api/vibration/multiple-shock-vibration/). +- API reference: [`vibration.human.multiple_shock`](/phonometry/reference/api/vibration/multiple-shock/). diff --git a/site/src/content/docs/guides/panel-sound-insulation.mdx b/site/src/content/docs/guides/panel-sound-insulation.mdx index a94bf7578..4497d1766 100644 --- a/site/src/content/docs/guides/panel-sound-insulation.mdx +++ b/site/src/content/docs/guides/panel-sound-insulation.mdx @@ -898,4 +898,4 @@ room-plate-cavity-plate-room chain. the measured counterpart of the theoretical point mobilities. - [Porous and multilayer absorbers](/phonometry/guides/porous-absorbers/): the cavity-fill models a double wall consumes. -- API reference: [`building.panel_transmission`](/phonometry/reference/api/building/panel-transmission/), [`building.masonry_cavity_wall`](/phonometry/reference/api/building/masonry-cavity-wall/), [`building.aperture_transmission`](/phonometry/reference/api/building/aperture-transmission/), [`vibration.radiation_efficiency`](/phonometry/reference/api/vibration/radiation-efficiency/) and [`vibration.point_mobility`](/phonometry/reference/api/vibration/point-mobility/). +- API reference: [`building.panel_transmission`](/phonometry/reference/api/building/panel-transmission/), [`building.masonry_cavity_wall`](/phonometry/reference/api/building/masonry-cavity-wall/), [`building.aperture_transmission`](/phonometry/reference/api/building/aperture-transmission/), [`vibration.structural.radiation_efficiency`](/phonometry/reference/api/vibration/radiation-efficiency/) and [`vibration.structural.point_mobility`](/phonometry/reference/api/vibration/point-mobility/). diff --git a/site/src/content/docs/guides/transfer-stiffness.mdx b/site/src/content/docs/guides/transfer-stiffness.mdx index 141f4dd9a..ceeee9f2f 100644 --- a/site/src/content/docs/guides/transfer-stiffness.mdx +++ b/site/src/content/docs/guides/transfer-stiffness.mdx @@ -289,4 +289,4 @@ apart within 1.5 dB) is likewise not checked in code. ## See also -- API reference: [`vibration.transfer_stiffness`](/phonometry/reference/api/vibration/transfer-stiffness/) and [`vibration.mechanical_mobility`](/phonometry/reference/api/vibration/mechanical-mobility/). +- API reference: [`vibration.structural.transfer_stiffness`](/phonometry/reference/api/vibration/transfer-stiffness/) and [`vibration.structural.mechanical_mobility`](/phonometry/reference/api/vibration/mechanical-mobility/). diff --git a/site/src/content/docs/reference/api/building/installed-structure-borne.md b/site/src/content/docs/reference/api/building/installed-structure-borne.md index 0f3f39df1..f1b5786b5 100644 --- a/site/src/content/docs/reference/api/building/installed-structure-borne.md +++ b/site/src/content/docs/reference/api/building/installed-structure-borne.md @@ -48,7 +48,7 @@ building. The chain closes the structural-vibroacoustics series: (Formula 17). The source and receiver mobilities/impedances are those of -[`phonometry.vibration.mechanical_mobility`](/phonometry/reference/api/vibration/mechanical-mobility/) and [`phonometry.vibration.transfer_stiffness`](/phonometry/reference/api/vibration/transfer-stiffness/). +[`phonometry.vibration.structural.mechanical_mobility`](/phonometry/reference/api/vibration/mechanical-mobility/) and [`phonometry.vibration.structural.transfer_stiffness`](/phonometry/reference/api/vibration/transfer-stiffness/). > Auto-generated from the source docstrings by `scripts/generate_api_docs.py` (`make api-docs`). Do not edit by hand. diff --git a/site/src/content/docs/reference/api/building/masonry-cavity-wall.md b/site/src/content/docs/reference/api/building/masonry-cavity-wall.md index 5a16b66f6..f121f6a31 100644 --- a/site/src/content/docs/reference/api/building/masonry-cavity-wall.md +++ b/site/src/content/docs/reference/api/building/masonry-cavity-wall.md @@ -114,7 +114,7 @@ area cancels and only the tie density `n` enters. | `frequency` | Frequencies `f`, in hertz (array, > 0). | | `mass1` | Surface density `rho_s1` of the excited leaf, in kg/m^2 (> 0). | | `mass2` | Surface density `rho_s2` of the receiving leaf, in kg/m^2 (> 0). | -| `bending_stiffness1` | Bending stiffness per unit width `B'` of leaf 1, in N.m (> 0); see [`phonometry.vibration.point_mobility.plate_bending_stiffness`](/phonometry/reference/api/vibration/point-mobility/#plate_bending_stiffness). | +| `bending_stiffness1` | Bending stiffness per unit width `B'` of leaf 1, in N.m (> 0); see [`phonometry.vibration.structural.point_mobility.plate_bending_stiffness`](/phonometry/reference/api/vibration/point-mobility/#plate_bending_stiffness). | | `bending_stiffness2` | Bending stiffness per unit width of leaf 2, in N.m. | | `ties_per_area` | Number of ties per unit area `n`, in 1/m^2 (> 0). | | `tie` | A name from [`WALL_TIE_STIFFNESS`](/phonometry/reference/api/building/masonry-cavity-wall/#wall_tie_stiffness), an explicit dynamic stiffness `k` in N/m, or `None` for a rigid connection ($Y_c = 0$, the screw/nail/bolt limit). | diff --git a/site/src/content/docs/reference/api/index.md b/site/src/content/docs/reference/api/index.md index 65c8f508f..18c644235 100644 --- a/site/src/content/docs/reference/api/index.md +++ b/site/src/content/docs/reference/api/index.md @@ -153,15 +153,15 @@ La referencia de la API se genera a partir de los docstrings del código (en ing | Module | Summary | | :--- | :--- | -| [`vibration.mechanical_mobility`](/phonometry/reference/api/vibration/mechanical-mobility/) | Mechanical mobility and the frequency-response-function family (ISO 7626-1:2011). | -| [`vibration.point_mobility`](/phonometry/reference/api/vibration/point-mobility/) | Point mobilities and impedances of infinite structures (Cremer, Heckl & Petersson 2005, Chapter 5, Table 5.1). | -| [`vibration.radiation_efficiency`](/phonometry/reference/api/vibration/radiation-efficiency/) | Radiation efficiency of a plate in bending (Hopkins 2007, Sound Insulation, Section 2.9; Leppington et al. | -| [`vibration.junction_transmission`](/phonometry/reference/api/vibration/junction-transmission/) | Bending-wave transmission coefficients for rigid plate junctions (Hopkins 2007, *Sound Insulation*, Section 5.2.1.3; Cremer et al. | -| [`vibration.experimental_sea`](/phonometry/reference/api/vibration/experimental-sea/) | Experimental statistical energy analysis: coupling loss factors from measured energies (Norton & Karczub Ch. | -| [`vibration.machine_diagnostics`](/phonometry/reference/api/vibration/machine-diagnostics/) | Kinematic fault frequencies of rotating machinery (Norton & Karczub Ch. | -| [`vibration.transfer_stiffness`](/phonometry/reference/api/vibration/transfer-stiffness/) | Dynamic transfer stiffness of resilient elements (ISO 10846-1/-2/-3). | -| [`vibration.human_vibration`](/phonometry/reference/api/vibration/human-vibration/) | Human exposure to whole-body and hand-transmitted vibration. | -| [`vibration.multiple_shock_vibration`](/phonometry/reference/api/vibration/multiple-shock-vibration/) | Whole-body vibration containing multiple shocks (ISO 2631-5:2018). | +| [`vibration.structural.mechanical_mobility`](/phonometry/reference/api/vibration/mechanical-mobility/) | Mechanical mobility and the frequency-response-function family (ISO 7626-1:2011). | +| [`vibration.structural.point_mobility`](/phonometry/reference/api/vibration/point-mobility/) | Point mobilities and impedances of infinite structures (Cremer, Heckl & Petersson 2005, Chapter 5, Table 5.1). | +| [`vibration.structural.radiation_efficiency`](/phonometry/reference/api/vibration/radiation-efficiency/) | Radiation efficiency of a plate in bending (Hopkins 2007, Sound Insulation, Section 2.9; Leppington et al. | +| [`vibration.structural.junction_transmission`](/phonometry/reference/api/vibration/junction-transmission/) | Bending-wave transmission coefficients for rigid plate junctions (Hopkins 2007, *Sound Insulation*, Section 5.2.1.3; Cremer et al. | +| [`vibration.structural.experimental_sea`](/phonometry/reference/api/vibration/experimental-sea/) | Experimental statistical energy analysis: coupling loss factors from measured energies (Norton & Karczub Ch. | +| [`vibration.machinery.diagnostics`](/phonometry/reference/api/vibration/diagnostics/) | Kinematic fault frequencies of rotating machinery (Norton & Karczub Ch. | +| [`vibration.structural.transfer_stiffness`](/phonometry/reference/api/vibration/transfer-stiffness/) | Dynamic transfer stiffness of resilient elements (ISO 10846-1/-2/-3). | +| [`vibration.human.exposure`](/phonometry/reference/api/vibration/exposure/) | Human exposure to whole-body and hand-transmitted vibration. | +| [`vibration.human.multiple_shock`](/phonometry/reference/api/vibration/multiple-shock/) | Whole-body vibration containing multiple shocks (ISO 2631-5:2018). | ## Environmental acoustics diff --git a/site/src/content/docs/reference/api/vibration/machine-diagnostics.md b/site/src/content/docs/reference/api/vibration/diagnostics.md similarity index 95% rename from site/src/content/docs/reference/api/vibration/machine-diagnostics.md rename to site/src/content/docs/reference/api/vibration/diagnostics.md index 70d94aced..10327a34d 100644 --- a/site/src/content/docs/reference/api/vibration/machine-diagnostics.md +++ b/site/src/content/docs/reference/api/vibration/diagnostics.md @@ -1,8 +1,8 @@ --- -title: "vibration.machine_diagnostics" +title: "vibration.machinery.diagnostics" description: "Kinematic fault frequencies of rotating machinery (Norton & Karczub Ch. 8)." sidebar: - label: "machine_diagnostics" + label: "diagnostics" --- Kinematic fault frequencies of rotating machinery (Norton & Karczub Ch. 8). @@ -24,7 +24,7 @@ synchronously with the shaft ([`time_synchronous_average`](/phonometry/reference/api/signals/synchronous-average/#time_synchronous_average)) or collapse the harmonic families in the cepstrum ([`cepstrum`](/phonometry/reference/api/signals/cepstrum/#cepstrum)). The result object's -[`FaultFrequencyResult.plot`](/phonometry/reference/api/vibration/machine-diagnostics/#faultfrequencyresultplot) draws the predicted lines **on top of a +[`FaultFrequencyResult.plot`](/phonometry/reference/api/vibration/diagnostics/#faultfrequencyresultplot) draws the predicted lines **on top of a measured envelope spectrum**, which is the working view. **Rolling-contact bearings** (Eqs. 8.4 to 8.14, after Shahan & Kamperman). @@ -148,7 +148,7 @@ both are independent of which race turns (Norton's Eqs. 8.8 and 8.14, and | `contact_angle_deg` | Contact angle `phi` between element and raceway, in degrees (Default: 0, a radial ball bearing); `0 <= phi < 90`. | | `rotating_race` | Which race turns with the shaft, `"inner"` (Default) or `"outer"`. | -**Returns:** A [`FaultFrequencyResult`](/phonometry/reference/api/vibration/machine-diagnostics/#faultfrequencyresult) (source `"rolling-contact bearing"`). +**Returns:** A [`FaultFrequencyResult`](/phonometry/reference/api/vibration/diagnostics/#faultfrequencyresult) (source `"rolling-contact bearing"`). **Raises** @@ -198,7 +198,7 @@ pattern turning at a different speed. | `n_vanes` | Number of stator vanes `V` (integer >= 1) to include the lobed interaction patterns (Default: `None`, blade tones only). | | `lobe_orders` | Highest `\|k\|` in $m_L = n\, N_{\text{blades}} \pm k\, N_{\text{vanes}}$ (integer >= 1, Default: 1). | -**Returns:** A [`FaultFrequencyResult`](/phonometry/reference/api/vibration/machine-diagnostics/#faultfrequencyresult) (source `"bladed rotor"`). +**Returns:** A [`FaultFrequencyResult`](/phonometry/reference/api/vibration/diagnostics/#faultfrequencyresult) (source `"bladed rotor"`). **Raises** @@ -226,10 +226,10 @@ they came from. | Name | Description | | :--- | :--- | -| `results` | Two or more [`FaultFrequencyResult`](/phonometry/reference/api/vibration/machine-diagnostics/#faultfrequencyresult) objects. | +| `results` | Two or more [`FaultFrequencyResult`](/phonometry/reference/api/vibration/diagnostics/#faultfrequencyresult) objects. | | `source` | Label for the merged family (Default: the sources joined by `" + "`). | -**Returns:** A [`FaultFrequencyResult`](/phonometry/reference/api/vibration/machine-diagnostics/#faultfrequencyresult) holding every line. +**Returns:** A [`FaultFrequencyResult`](/phonometry/reference/api/vibration/diagnostics/#faultfrequencyresult) holding every line. **Raises** @@ -253,7 +253,7 @@ A family of predicted fault lines for one machine element. | Name | Description | | :--- | :--- | -| `lines` | The predicted [`FaultLine`](/phonometry/reference/api/vibration/machine-diagnostics/#faultline) entries, in the order the generating function produced them. | +| `lines` | The predicted [`FaultLine`](/phonometry/reference/api/vibration/diagnostics/#faultline) entries, in the order the generating function produced them. | | `shaft_rate` | Shaft rotational frequency `fs`, in hertz. | | `source` | Description of the element (`"rolling-contact bearing"`, `"gear pair"`, ...), used as the plot title. | @@ -354,7 +354,7 @@ much narrower than the highest predicted harmonic. | `low` | Lower edge, in hertz (>= 0). | | `high` | Upper edge, in hertz (> *low*). | -**Returns:** A [`FaultFrequencyResult`](/phonometry/reference/api/vibration/machine-diagnostics/#faultfrequencyresult) with the surviving lines. +**Returns:** A [`FaultFrequencyResult`](/phonometry/reference/api/vibration/diagnostics/#faultfrequencyresult) with the surviving lines. **Raises** @@ -380,7 +380,7 @@ One predicted discrete line of a machine's kinematic signature. | Name | Description | | :--- | :--- | -| `name` | Short label, unique within a result (`"BPFO"`, `"2xGMF"`, `"GMF-1x"`, ...). Acronyms are language neutral and are what the [`FaultFrequencyResult.plot`](/phonometry/reference/api/vibration/machine-diagnostics/#faultfrequencyresultplot) overlay annotates. | +| `name` | Short label, unique within a result (`"BPFO"`, `"2xGMF"`, `"GMF-1x"`, ...). Acronyms are language neutral and are what the [`FaultFrequencyResult.plot`](/phonometry/reference/api/vibration/diagnostics/#faultfrequencyresultplot) overlay annotates. | | `frequency` | Predicted frequency, in hertz. | | `order` | Frequency expressed in shaft orders, `frequency / fs`. | | `family` | One of `"shaft"`, `"bearing"`, `"gear"`, `"motor"` or `"blade"`. | @@ -423,7 +423,7 @@ Only positive sideband frequencies are returned. | `sidebands` | Sideband order per harmonic (integer >= 0, Default: 0, no sidebands). | | `sideband_rate` | Modulation rate `f_mod`, in hertz (> 0, Default: the wheel's own shaft rate). | -**Returns:** A [`FaultFrequencyResult`](/phonometry/reference/api/vibration/machine-diagnostics/#faultfrequencyresult) (source `"gear pair"`). +**Returns:** A [`FaultFrequencyResult`](/phonometry/reference/api/vibration/diagnostics/#faultfrequencyresult) (source `"gear pair"`). **Raises** @@ -486,7 +486,7 @@ it by the pole count. | `slot_harmonics` | Number of slot-harmonic orders `n` (integer >= 1, Default: 1, the fundamental `R fs` alone). | | `sidebands` | Sideband order around the fundamental slot harmonic at +/- the shaft rate and +/- the slip frequency (integer >= 0, Default: 0). | -**Returns:** A [`FaultFrequencyResult`](/phonometry/reference/api/vibration/machine-diagnostics/#faultfrequencyresult) (source `"induction motor"`). +**Returns:** A [`FaultFrequencyResult`](/phonometry/reference/api/vibration/diagnostics/#faultfrequencyresult) (source `"induction motor"`). **Raises** diff --git a/site/src/content/docs/reference/api/vibration/experimental-sea.md b/site/src/content/docs/reference/api/vibration/experimental-sea.md index bdaa58e77..091dd2840 100644 --- a/site/src/content/docs/reference/api/vibration/experimental-sea.md +++ b/site/src/content/docs/reference/api/vibration/experimental-sea.md @@ -1,5 +1,5 @@ --- -title: "vibration.experimental_sea" +title: "vibration.structural.experimental_sea" description: "Experimental statistical energy analysis: coupling loss factors from measured energies (Norton & Karczub Ch. 6)." sidebar: label: "experimental_sea" diff --git a/site/src/content/docs/reference/api/vibration/human-vibration.md b/site/src/content/docs/reference/api/vibration/exposure.md similarity index 93% rename from site/src/content/docs/reference/api/vibration/human-vibration.md rename to site/src/content/docs/reference/api/vibration/exposure.md index 1edd38e96..3b256e96b 100644 --- a/site/src/content/docs/reference/api/vibration/human-vibration.md +++ b/site/src/content/docs/reference/api/vibration/exposure.md @@ -1,8 +1,8 @@ --- -title: "vibration.human_vibration" +title: "vibration.human.exposure" description: "Human exposure to whole-body and hand-transmitted vibration." sidebar: - label: "human_vibration" + label: "exposure" --- Human exposure to whole-body and hand-transmitted vibration. @@ -47,12 +47,12 @@ standards' own analog definitions, clean-room: ISO 5349-1 vector total `a_hv` (Annex, Part A, point 1); the whole-body `A(8)` is based on the *highest* of the frequency-weighted axis values $1.4 a_{wx}$, $1.4 a_{wy}$, $a_{wz}$ (Annex, Part B, - point 1; see [`wbv_exposure_basis`](/phonometry/reference/api/vibration/human-vibration/#wbv_exposure_basis)), not on the ISO 2631-1 Eq. (10) + point 1; see [`wbv_exposure_basis`](/phonometry/reference/api/vibration/exposure/#wbv_exposure_basis)), not on the ISO 2631-1 Eq. (10) vector total. The band (spectrum) method and the exposure arithmetic carry the standards' worked-example oracles; the time-domain metrics operate on a weighted -acceleration signal, which [`apply_weighting`](/phonometry/reference/api/vibration/human-vibration/#apply_weighting) produces from a raw record +acceleration signal, which [`apply_weighting`](/phonometry/reference/api/vibration/exposure/#apply_weighting) produces from a raw record by applying the exact analog response of ISO 8041-1 in the frequency domain. > Auto-generated from the source docstrings by `scripts/generate_api_docs.py` (`make api-docs`). Do not edit by hand. @@ -65,7 +65,7 @@ apply_weighting(signal: ArrayLike, fs: float, name: str) -> Real Apply frequency weighting `name` to a time signal (ISO 8041-1). -The exact analog response [`frequency_weighting`](/phonometry/reference/api/vibration/human-vibration/#frequency_weighting) is applied in the +The exact analog response [`frequency_weighting`](/phonometry/reference/api/vibration/exposure/#frequency_weighting) is applied in the frequency domain (real FFT), so the weighted signal reproduces both the magnitude and phase of the standard's cascade without bilinear warping. The multiplication is circular, so the record wraps at its ends; apply it @@ -78,7 +78,7 @@ negligible, as for any block frequency-domain filtering. | :--- | :--- | | `signal` | Unweighted acceleration time history (1-D), in m/s2. | | `fs` | Sampling frequency, in hertz (> 0). | -| `name` | Weighting name (one of [`WEIGHTING_NAMES`](/phonometry/reference/api/vibration/human-vibration/#weighting_names)). | +| `name` | Weighting name (one of [`WEIGHTING_NAMES`](/phonometry/reference/api/vibration/exposure/#weighting_names)). | **Returns:** The frequency-weighted acceleration signal, same length as input. @@ -124,7 +124,7 @@ The modulus of the ratio of the peak weighted acceleration to its r.m.s. value. ISO 2631-1 6.2.2 deems the basic (r.m.s.) method adequate for a crest factor up to 9. -Emits a [`HumanVibrationWarning`](/phonometry/reference/api/vibration/human-vibration/#humanvibrationwarning) when the crest factor exceeds 9, +Emits a [`HumanVibrationWarning`](/phonometry/reference/api/vibration/exposure/#humanvibrationwarning) when the crest factor exceeds 9, the threshold above which ISO 2631-1 6.2.2 deems the basic method inadequate. @@ -147,7 +147,7 @@ Daily exposure `A(8)` for one operation (ISO 5349-1 Eq. (2)). $A(8) = a_{hv} \sqrt{T / T_0}$ with $T_0 = 8$ h. The identical form gives the whole-body `A(8)` of Directive 2002/44/EC, whose magnitude is the Annex Part B dominant-axis value (see -[`wbv_exposure_basis`](/phonometry/reference/api/vibration/human-vibration/#wbv_exposure_basis)) rather than a vector total. +[`wbv_exposure_basis`](/phonometry/reference/api/vibration/exposure/#wbv_exposure_basis)) rather than a vector total. **Parameters** @@ -186,19 +186,19 @@ The Directive fixes the per-operation magnitude each kind must be fed with (Annex, points 1): for `kind="hav"` the ISO 5349-1 Eq. (1) vector total `a_hv` (Part A); for `kind="wbv"` the *highest* frequency- weighted axis value `max(1,4*a_wx, 1,4*a_wy, a_wz)` that -[`wbv_exposure_basis`](/phonometry/reference/api/vibration/human-vibration/#wbv_exposure_basis) returns (Part B), **not** the ISO 2631-1 +[`wbv_exposure_basis`](/phonometry/reference/api/vibration/exposure/#wbv_exposure_basis) returns (Part B), **not** the ISO 2631-1 Eq. (10) vector total `a_v`. **Parameters** | Name | Description | | :--- | :--- | -| `total_values` | Per-operation vibration magnitude, in m/s2: the hand-arm vibration total value `a_hv,i` (`kind="hav"`) or the Directive Part B dominant-axis value of [`wbv_exposure_basis`](/phonometry/reference/api/vibration/human-vibration/#wbv_exposure_basis) (`kind="wbv"`). | +| `total_values` | Per-operation vibration magnitude, in m/s2: the hand-arm vibration total value `a_hv,i` (`kind="hav"`) or the Directive Part B dominant-axis value of [`wbv_exposure_basis`](/phonometry/reference/api/vibration/exposure/#wbv_exposure_basis) (`kind="wbv"`). | | `durations_s` | Duration `T_i` per operation, in seconds. | | `kind` | `"hav"` or `"wbv"` (selects the EAV/ELV). | | `labels` | Optional operation labels; defaults to `op 1`, `op 2`, ... | -**Returns:** A [`DailyVibrationExposure`](/phonometry/reference/api/vibration/human-vibration/#dailyvibrationexposure) with `.plot()`. +**Returns:** A [`DailyVibrationExposure`](/phonometry/reference/api/vibration/exposure/#dailyvibrationexposure) with `.plot()`. **Raises** @@ -230,7 +230,7 @@ A daily exposure built from several operations, with its assessment. | `total_values` | Vibration total value `a_hvi` per operation, in m/s2. | | `durations_s` | Duration `T_i` per operation, in seconds. | | `partials` | Partial exposure `A_i(8)` per operation, in m/s2. | -| `assessment` | The [`ExposureAssessment`](/phonometry/reference/api/vibration/human-vibration/#exposureassessment) of `a8`. | +| `assessment` | The [`ExposureAssessment`](/phonometry/reference/api/vibration/exposure/#exposureassessment) of `a8`. | ### DailyVibrationExposure.plot() @@ -348,7 +348,7 @@ Assess a daily exposure against Directive 2002/44/EC (Article 3). | `kind` | `"hav"` (hand-arm) or `"wbv"` (whole-body). | | `metric` | `"a8"` (default) or `"vdv"`. | -**Returns:** An [`ExposureAssessment`](/phonometry/reference/api/vibration/human-vibration/#exposureassessment). +**Returns:** An [`ExposureAssessment`](/phonometry/reference/api/vibration/exposure/#exposureassessment). **Raises** @@ -401,10 +401,10 @@ transition and upward step - of weighting `name` at `frequencies`. | Name | Description | | :--- | :--- | -| `name` | Weighting name (one of [`WEIGHTING_NAMES`](/phonometry/reference/api/vibration/human-vibration/#weighting_names)). | +| `name` | Weighting name (one of [`WEIGHTING_NAMES`](/phonometry/reference/api/vibration/exposure/#weighting_names)). | | `frequencies` | Frequencies at which to evaluate, in hertz (> 0). | -**Returns:** A [`WeightingResponse`](/phonometry/reference/api/vibration/human-vibration/#weightingresponse) with `.plot()`. +**Returns:** A [`WeightingResponse`](/phonometry/reference/api/vibration/exposure/#weightingresponse) with `.plot()`. **Raises** @@ -547,7 +547,7 @@ Daily exposure `A(8)` for one operation (ISO 5349-1 Eq. (2)). $A(8) = a_{hv} \sqrt{T / T_0}$ with $T_0 = 8$ h. The identical form gives the whole-body `A(8)` of Directive 2002/44/EC, whose magnitude is the Annex Part B dominant-axis value (see -[`wbv_exposure_basis`](/phonometry/reference/api/vibration/human-vibration/#wbv_exposure_basis)) rather than a vector total. +[`wbv_exposure_basis`](/phonometry/reference/api/vibration/exposure/#wbv_exposure_basis)) rather than a vector total. **Parameters** @@ -716,7 +716,7 @@ $1.4 a_{wy}$, $a_{wz}$ for a seated or standing worker (Annex, Part B, point 1, with the ISO 2631-1 clause 7.2.3 multiplying factors), **not** on the ISO 2631-1 Eq. (10) vector total `a_v`. Feed the returned dominant-axis value to -[`daily_vibration_exposure`](/phonometry/reference/api/vibration/human-vibration/#daily_vibration_exposure) (`kind="wbv"`) for a +[`daily_vibration_exposure`](/phonometry/reference/api/vibration/exposure/#daily_vibration_exposure) (`kind="wbv"`) for a Directive-conforming whole-body assessment; the hand-arm basis is the vector total `a_hv` instead (Annex, Part A, point 1). @@ -770,9 +770,9 @@ comparing against the tabulated factors; a nominal label (e.g. | :--- | :--- | | `band_accelerations` | r.m.s. acceleration $a_i$ per band, in m/s2. | | `frequencies` | Band centre frequencies, in hertz (true one-third-octave centres $10^{n/10}$ for table-conformant band values). | -| `weighting` | Weighting name (one of [`WEIGHTING_NAMES`](/phonometry/reference/api/vibration/human-vibration/#weighting_names)). | +| `weighting` | Weighting name (one of [`WEIGHTING_NAMES`](/phonometry/reference/api/vibration/exposure/#weighting_names)). | -**Returns:** A [`WeightedSpectrum`](/phonometry/reference/api/vibration/human-vibration/#weightedspectrum) with `.plot()`. +**Returns:** A [`WeightedSpectrum`](/phonometry/reference/api/vibration/exposure/#weightedspectrum) with `.plot()`. **Raises** @@ -801,7 +801,7 @@ A weighted one-third-octave acceleration spectrum and its `a_w`. | :--- | :--- | | `frequencies` | Band centre frequencies, in hertz. | | `band_accelerations` | Unweighted r.m.s. acceleration per band, in m/s2. | -| `weighting_name` | Weighting applied (one of [`WEIGHTING_NAMES`](/phonometry/reference/api/vibration/human-vibration/#weighting_names)). | +| `weighting_name` | Weighting applied (one of [`WEIGHTING_NAMES`](/phonometry/reference/api/vibration/exposure/#weighting_names)). | | `weighting_factors` | Weighting factor `W_i` per band. | | `weighted` | Weighted band contribution `W_i*a_i`, in m/s2. | | `overall` | Overall weighted r.m.s. acceleration `a_w`, in m/s2. | @@ -830,14 +830,14 @@ weighting_factors(name: str, frequencies: ArrayLike) -> Real Weighting factors `|H(f)|` of weighting `name` (ISO 8041-1). -Convenience wrapper over [`frequency_weighting`](/phonometry/reference/api/vibration/human-vibration/#frequency_weighting) returning only the +Convenience wrapper over [`frequency_weighting`](/phonometry/reference/api/vibration/exposure/#frequency_weighting) returning only the magnitude array (the `W_i` of ISO 2631-1 Eq. (9) / ISO 5349-1 Eq. (A.1)). **Parameters** | Name | Description | | :--- | :--- | -| `name` | Weighting name (one of [`WEIGHTING_NAMES`](/phonometry/reference/api/vibration/human-vibration/#weighting_names)). | +| `name` | Weighting name (one of [`WEIGHTING_NAMES`](/phonometry/reference/api/vibration/exposure/#weighting_names)). | | `frequencies` | Band centre frequencies, in hertz. | **Returns:** Weighting factor per frequency. @@ -868,7 +868,7 @@ A frequency-weighting magnitude response (ISO 8041-1, Formula (5)). | Name | Description | | :--- | :--- | -| `name` | Weighting name (one of [`WEIGHTING_NAMES`](/phonometry/reference/api/vibration/human-vibration/#weighting_names)). | +| `name` | Weighting name (one of [`WEIGHTING_NAMES`](/phonometry/reference/api/vibration/exposure/#weighting_names)). | | `frequencies` | Frequencies at which the response was evaluated, in Hz. | | `response` | Complex weighting $H(j2\pi f)$ per frequency. | | `magnitude` | Weighting factor $\lvert H \rvert$ per frequency. | diff --git a/site/src/content/docs/reference/api/vibration/junction-transmission.md b/site/src/content/docs/reference/api/vibration/junction-transmission.md index 97b63649e..d20199c03 100644 --- a/site/src/content/docs/reference/api/vibration/junction-transmission.md +++ b/site/src/content/docs/reference/api/vibration/junction-transmission.md @@ -1,5 +1,5 @@ --- -title: "vibration.junction_transmission" +title: "vibration.structural.junction_transmission" description: "Bending-wave transmission coefficients for rigid plate junctions (Hopkins 2007, Sound Insulation, Section 5.2.1.3; Cremer et al. 1973; Craik 1981, 1996)." sidebar: label: "junction_transmission" @@ -130,7 +130,7 @@ i.e. $\bar{\tau}_{12} = \chi \bar{\tau}_{21}$. **Two shortcuts for right-angle joints (Norton & Karczub 2003, Section 6.6.1).** Alongside the angle-resolved wave approach above, the SEA literature uses a pair of closed forms that need no integration, which is what the -experimental SEA of [`phonometry.vibration.experimental_sea`](/phonometry/reference/api/vibration/experimental-sea/) is normally +experimental SEA of [`phonometry.vibration.structural.experimental_sea`](/phonometry/reference/api/vibration/experimental-sea/) is normally compared against: * [`right_angle_transmission_coefficient`](/phonometry/reference/api/vibration/junction-transmission/#right_angle_transmission_coefficient) (Norton Eqs. 6.53 to 6.55, after @@ -241,7 +241,7 @@ source-plate bending-wave group velocity `cg_i`, the junction length | Name | Description | | :--- | :--- | | `transmission_coefficient` | Angular-average `tau_ij` (scalar/array). | -| `group_velocity` | Source-plate bending-wave group velocity `cg_i`, in m/s (> 0). For a thin plate $c_g = 2 c_B$ with the bending phase speed `cB` (see [`phonometry.vibration.point_mobility.plate_bending_wave_speed`](/phonometry/reference/api/vibration/point-mobility/)). | +| `group_velocity` | Source-plate bending-wave group velocity `cg_i`, in m/s (> 0). For a thin plate $c_g = 2 c_B$ with the bending phase speed `cB` (see [`phonometry.vibration.structural.point_mobility.plate_bending_wave_speed`](/phonometry/reference/api/vibration/point-mobility/)). | | `junction_length` | Junction length `L_ij`, in m (> 0). | | `frequency` | Frequency `f`, in hertz (scalar or array, > 0). | | `plate_area` | Source-plate area `S_i`, in m^2 (> 0). | diff --git a/site/src/content/docs/reference/api/vibration/mechanical-mobility.md b/site/src/content/docs/reference/api/vibration/mechanical-mobility.md index 43b7002ba..faa765267 100644 --- a/site/src/content/docs/reference/api/vibration/mechanical-mobility.md +++ b/site/src/content/docs/reference/api/vibration/mechanical-mobility.md @@ -1,5 +1,5 @@ --- -title: "vibration.mechanical_mobility" +title: "vibration.structural.mechanical_mobility" description: "Mechanical mobility and the frequency-response-function family (ISO 7626-1:2011)." sidebar: label: "mechanical_mobility" diff --git a/site/src/content/docs/reference/api/vibration/multiple-shock-vibration.md b/site/src/content/docs/reference/api/vibration/multiple-shock.md similarity index 95% rename from site/src/content/docs/reference/api/vibration/multiple-shock-vibration.md rename to site/src/content/docs/reference/api/vibration/multiple-shock.md index 934d31bb2..bcb7bad0b 100644 --- a/site/src/content/docs/reference/api/vibration/multiple-shock-vibration.md +++ b/site/src/content/docs/reference/api/vibration/multiple-shock.md @@ -1,8 +1,8 @@ --- -title: "vibration.multiple_shock_vibration" +title: "vibration.human.multiple_shock" description: "Whole-body vibration containing multiple shocks (ISO 2631-5:2018)." sidebar: - label: "multiple_shock_vibration" + label: "multiple_shock" --- Whole-body vibration containing multiple shocks (ISO 2631-5:2018). @@ -17,8 +17,8 @@ response, and the Annex C stress conversion $m_z$ is the vertical one. The horizontal spinal model of the withdrawn 2004 edition is not reproduced. Assess horizontal whole-body exposure with the ISO 2631-1 metrics in this domain instead: the weighted r.m.s. acceleration -([`weighted_acceleration`](/phonometry/reference/api/vibration/human-vibration/#weighted_acceleration)) and the vibration dose -value ([`vibration_dose_value`](/phonometry/reference/api/vibration/human-vibration/#vibration_dose_value)). +([`weighted_acceleration`](/phonometry/reference/api/vibration/exposure/#weighted_acceleration)) and the vibration dose +value ([`vibration_dose_value`](/phonometry/reference/api/vibration/exposure/#vibration_dose_value)). A seat-to-spine transfer function $H(\omega)$ (clause 5.2, Formula 1) maps the measured seat acceleration $a_z(t)$ to the spinal response @@ -78,7 +78,7 @@ Acceleration dose $D_z$ from a seat acceleration time history. Filters the acceleration through the seat-to-spine transfer function (Formula 2), takes the positive response peaks and combines them by Formula 3. The input must be conditioned (DC-removed); see -[`spinal_response`](/phonometry/reference/api/vibration/multiple-shock-vibration/#spinal_response). +[`spinal_response`](/phonometry/reference/api/vibration/multiple-shock/#spinal_response). **Parameters** @@ -183,7 +183,7 @@ Probability of lumbar injury $P(R)$ (Annex C, Formula C.5). | Name | Description | | :--- | :--- | -| `risk` | The stress variable $R$ (see [`injury_risk`](/phonometry/reference/api/vibration/multiple-shock-vibration/#injury_risk)); scalar or array-like. | +| `risk` | The stress variable $R$ (see [`injury_risk`](/phonometry/reference/api/vibration/multiple-shock/#injury_risk)); scalar or array-like. | | `sex` | `"male"` or `"female"` (sets the Weibull coefficients). | **Returns:** The injury probability $P = 1 - \exp(-(R/\alpha)^\beta)$ in 0-1; a float for a scalar input, otherwise an array. Negative $R$ gives 0. @@ -250,12 +250,12 @@ Chains the Clause 5 dose and the Annex C risk: spinal response (Formula 2), acceleration dose (Formula 3), daily dose (Formula 4), compressive stress (C.1), stress variable $R$ (C.3) and injury probability (C.5). The input must be conditioned (DC-removed); see -[`spinal_response`](/phonometry/reference/api/vibration/multiple-shock-vibration/#spinal_response). +[`spinal_response`](/phonometry/reference/api/vibration/multiple-shock/#spinal_response). The model is vertical-axis only (clause 4a of the 2018 edition); for horizontal whole-body exposure use the ISO 2631-1 metrics in this domain -([`weighted_acceleration`](/phonometry/reference/api/vibration/human-vibration/#weighted_acceleration), -[`vibration_dose_value`](/phonometry/reference/api/vibration/human-vibration/#vibration_dose_value)). +([`weighted_acceleration`](/phonometry/reference/api/vibration/exposure/#weighted_acceleration), +[`vibration_dose_value`](/phonometry/reference/api/vibration/exposure/#vibration_dose_value)). **Parameters** @@ -271,7 +271,7 @@ horizontal whole-body exposure use the ISO 2631-1 metrics in this domain | `sex` | `"male"` or `"female"`. | | `mz` | Stress conversion $m_z$ (MPa per m/s2); defaults to the sex-specific value. | -**Returns:** The [`MultipleShockResult`](/phonometry/reference/api/vibration/multiple-shock-vibration/#multipleshockresult). +**Returns:** The [`MultipleShockResult`](/phonometry/reference/api/vibration/multiple-shock/#multipleshockresult). ## MultipleShockResult diff --git a/site/src/content/docs/reference/api/vibration/point-mobility.md b/site/src/content/docs/reference/api/vibration/point-mobility.md index fd173dd60..a32da055b 100644 --- a/site/src/content/docs/reference/api/vibration/point-mobility.md +++ b/site/src/content/docs/reference/api/vibration/point-mobility.md @@ -1,5 +1,5 @@ --- -title: "vibration.point_mobility" +title: "vibration.structural.point_mobility" description: "Point mobilities and impedances of infinite structures (Cremer, Heckl & Petersson 2005, Chapter 5, Table 5.1)." sidebar: label: "point_mobility" @@ -320,7 +320,7 @@ Bending stiffness of a thin plate per unit width (Cremer Eq. 4.22). $B' = E h^3 / (12 (1 - \nu^2))$, the plate bending stiffness `B'` in N.m used throughout this module and by the coincidence frequency of -[`phonometry.vibration.radiation_efficiency.coincidence_frequency`](/phonometry/reference/api/vibration/radiation-efficiency/#coincidence_frequency). +[`phonometry.vibration.structural.radiation_efficiency.coincidence_frequency`](/phonometry/reference/api/vibration/radiation-efficiency/#coincidence_frequency). **Parameters** diff --git a/site/src/content/docs/reference/api/vibration/radiation-efficiency.md b/site/src/content/docs/reference/api/vibration/radiation-efficiency.md index a27b4fd6a..cb237c54d 100644 --- a/site/src/content/docs/reference/api/vibration/radiation-efficiency.md +++ b/site/src/content/docs/reference/api/vibration/radiation-efficiency.md @@ -1,5 +1,5 @@ --- -title: "vibration.radiation_efficiency" +title: "vibration.structural.radiation_efficiency" description: "Radiation efficiency of a plate in bending (Hopkins 2007, Sound Insulation, Section 2.9; Leppington et al. 1982; Maidanik 1962)." sidebar: label: "radiation_efficiency" @@ -82,7 +82,7 @@ $f_c = (c_0^2 / 2\pi) \sqrt{m'' / B'}$ (identical to Bies Eq. 7.3). | Name | Description | | :--- | :--- | | `mass_per_area` | Mass per unit area `m''`, in kg/m^2. | -| `bending_stiffness` | Bending stiffness per unit width `B'`, in N.m (see [`phonometry.vibration.point_mobility.plate_bending_stiffness`](/phonometry/reference/api/vibration/point-mobility/#plate_bending_stiffness)). | +| `bending_stiffness` | Bending stiffness per unit width `B'`, in N.m (see [`phonometry.vibration.structural.point_mobility.plate_bending_stiffness`](/phonometry/reference/api/vibration/point-mobility/#plate_bending_stiffness)). | | `speed_of_sound` | Speed of sound in air `c0` (Default: 343 m/s). | **Returns:** The coincidence frequency `fc`, in hertz. diff --git a/site/src/content/docs/reference/api/vibration/transfer-stiffness.md b/site/src/content/docs/reference/api/vibration/transfer-stiffness.md index d70c054d1..05dd0f5a4 100644 --- a/site/src/content/docs/reference/api/vibration/transfer-stiffness.md +++ b/site/src/content/docs/reference/api/vibration/transfer-stiffness.md @@ -1,5 +1,5 @@ --- -title: "vibration.transfer_stiffness" +title: "vibration.structural.transfer_stiffness" description: "Dynamic transfer stiffness of resilient elements (ISO 10846-1/-2/-3)." sidebar: label: "transfer_stiffness" diff --git a/site/src/content/docs/reference/errata.md b/site/src/content/docs/reference/errata.md index 0a6908d0e..ed78fd8be 100644 --- a/site/src/content/docs/reference/errata.md +++ b/site/src/content/docs/reference/errata.md @@ -1835,9 +1835,9 @@ which is the check that enforces the rule; see whole 125 Hz to 2 kHz column to better than 0,7 %; with the printed (unsquared) denominator the result is not a loss factor at all. - **Library behaviour:** `point_connection_coupling_loss_factor` in - [`junction_transmission.py`](https://github.com/jmrplens/phonometry/blob/main/src/phonometry/vibration/junction_transmission.py) + [`junction_transmission.py`](https://github.com/jmrplens/phonometry/blob/main/src/phonometry/vibration/structural/junction_transmission.py) implements the squared form, with the printed column pinned by a regression - test ([`tests/vibration/test_junction_transmission.py`](https://github.com/jmrplens/phonometry/blob/main/tests/vibration/test_junction_transmission.py)) + test ([`tests/vibration/structural/test_junction_transmission.py`](https://github.com/jmrplens/phonometry/blob/main/tests/vibration/structural/test_junction_transmission.py)) and a note at the formula. - **Status:** unreported (textbook rather than a standard). @@ -1862,7 +1862,7 @@ which is the check that enforces the rule; see oracle; $\eta_{21}$ is obtained from Eq. (6.8) with the full modal densities, and a test pins the 2,292 ratio explicitly - ([`tests/vibration/test_junction_transmission.py`](https://github.com/jmrplens/phonometry/blob/main/tests/vibration/test_junction_transmission.py)). + ([`tests/vibration/structural/test_junction_transmission.py`](https://github.com/jmrplens/phonometry/blob/main/tests/vibration/structural/test_junction_transmission.py)). - **Status:** unreported (textbook rather than a standard). ## Norton & Karczub 2e (2003), problem 6.10 (platform area) @@ -1888,10 +1888,10 @@ which is the check that enforces the rule; see all three printed answers within 0,4 %; the cylinder's own energy and modal density come out unchanged either way. - **Library behaviour:** `power_injection_clf` in - [`experimental_sea.py`](https://github.com/jmrplens/phonometry/blob/main/src/phonometry/vibration/experimental_sea.py) + [`experimental_sea.py`](https://github.com/jmrplens/phonometry/blob/main/src/phonometry/vibration/structural/experimental_sea.py) implements the inversion as published; the regression test uses the free platform area and documents the discrepancy - ([`tests/vibration/test_experimental_sea.py`](https://github.com/jmrplens/phonometry/blob/main/tests/vibration/test_experimental_sea.py)). + ([`tests/vibration/structural/test_experimental_sea.py`](https://github.com/jmrplens/phonometry/blob/main/tests/vibration/structural/test_experimental_sea.py)). - **Status:** unreported (textbook rather than a standard). ## Norton & Karczub 2e (2003), problem 3.14 (structural loss factor) diff --git a/site/src/generated/api-sidebar.mjs b/site/src/generated/api-sidebar.mjs index 03f832619..2d0ef65f1 100644 --- a/site/src/generated/api-sidebar.mjs +++ b/site/src/generated/api-sidebar.mjs @@ -161,10 +161,10 @@ export const apiSidebar = { 'reference/api/vibration/radiation-efficiency', 'reference/api/vibration/junction-transmission', 'reference/api/vibration/experimental-sea', - 'reference/api/vibration/machine-diagnostics', + 'reference/api/vibration/diagnostics', 'reference/api/vibration/transfer-stiffness', - 'reference/api/vibration/human-vibration', - 'reference/api/vibration/multiple-shock-vibration', + 'reference/api/vibration/exposure', + 'reference/api/vibration/multiple-shock', ], }, { diff --git a/src/phonometry/__init__.py b/src/phonometry/__init__.py index 5d507c32d..8f75ca0eb 100644 --- a/src/phonometry/__init__.py +++ b/src/phonometry/__init__.py @@ -1415,17 +1415,7 @@ weston_propagation_loss, weston_regime_boundaries, ) -from .vibration.experimental_sea import ( - PowerInjectionResult, - bar_modal_density, - beam_modal_density, - cylindrical_shell_modal_density, - flat_plate_modal_density, - power_injection_clf, - power_injection_matrix, - ring_frequency, -) -from .vibration.human_vibration import ( +from .vibration.human.exposure import ( HAV_EAV_A8, HAV_ELV_A8, REFERENCE_ACCELERATION, @@ -1460,7 +1450,43 @@ weighted_acceleration, weighting_factors, ) -from .vibration.junction_transmission import ( +from .vibration.human.multiple_shock import ( + MultipleShockResult, + acceleration_dose, + compression_dose, + daily_dose, + daily_dose_multi, + dose_from_peaks, + injury_probability, + injury_risk, + multiple_shock_assessment, + response_peaks, + seat_to_spine_transfer, + spinal_response, + static_stress, + ultimate_strength, +) +from .vibration.machinery.diagnostics import ( + FaultFrequencyResult, + FaultLine, + bearing_fault_frequencies, + blade_pass_frequencies, + combine_fault_lines, + gear_mesh_frequencies, + induction_motor_frequencies, + shaft_rate, +) +from .vibration.structural.experimental_sea import ( + PowerInjectionResult, + bar_modal_density, + beam_modal_density, + cylindrical_shell_modal_density, + flat_plate_modal_density, + power_injection_clf, + power_injection_matrix, + ring_frequency, +) +from .vibration.structural.junction_transmission import ( JunctionTransmissionResult, angular_average_transmission_coefficient, corner_transmission_coefficient, @@ -1473,17 +1499,7 @@ straight_transmission_coefficient, wave_vibration_reduction_index, ) -from .vibration.machine_diagnostics import ( - FaultFrequencyResult, - FaultLine, - bearing_fault_frequencies, - blade_pass_frequencies, - combine_fault_lines, - gear_mesh_frequencies, - induction_motor_frequencies, - shaft_rate, -) -from .vibration.mechanical_mobility import ( +from .vibration.structural.mechanical_mobility import ( FRF_UNITS, MobilityResult, RigidMassCalibrationResult, @@ -1496,23 +1512,7 @@ sdof_mobility_result, sdof_receptance, ) -from .vibration.multiple_shock_vibration import ( - MultipleShockResult, - acceleration_dose, - compression_dose, - daily_dose, - daily_dose_multi, - dose_from_peaks, - injury_probability, - injury_risk, - multiple_shock_assessment, - response_peaks, - seat_to_spine_transfer, - spinal_response, - static_stress, - ultimate_strength, -) -from .vibration.point_mobility import ( +from .vibration.structural.point_mobility import ( infinite_beam_mobility, infinite_beam_moment_mobility, infinite_beam_point_mobility, @@ -1523,12 +1523,12 @@ longitudinal_rod_impedance, plate_bending_stiffness, ) -from .vibration.radiation_efficiency import ( +from .vibration.structural.radiation_efficiency import ( RadiationEfficiencyResult, coincidence_frequency, radiation_efficiency, ) -from .vibration.transfer_stiffness import ( +from .vibration.structural.transfer_stiffness import ( REFERENCE_STIFFNESS, TRANSMISSIBILITY_LIMIT, TransferStiffnessResult, diff --git a/src/phonometry/_compat.py b/src/phonometry/_compat.py index 0a6a99389..8392a9d16 100644 --- a/src/phonometry/_compat.py +++ b/src/phonometry/_compat.py @@ -11,7 +11,9 @@ subpackages into domain ones (``phonometry.metrology`` into ``phonometry.filters``, ``phonometry.signals`` and a narrowed ``phonometry.metrology``; the speech intelligibility of - ``phonometry.hearing`` into ``phonometry.speech``). Removed in 5.0. + ``phonometry.hearing`` into ``phonometry.speech``), and gives the large + domains a second level (``phonometry.vibration`` into ``structural``, + ``human`` and ``machinery``). Removed in 5.0. Every public module path that moved stays importable through the shims registered here: ``import phonometry.`` and ``from phonometry. @@ -97,10 +99,13 @@ "phonometry.lab_insulation": "phonometry.building.lab_insulation", "phonometry.structure_borne_power": "phonometry.building.structure_borne_power", "phonometry.survey_insulation": "phonometry.building.survey_insulation", - "phonometry.human_vibration": "phonometry.vibration.human_vibration", - "phonometry.mechanical_mobility": "phonometry.vibration.mechanical_mobility", - "phonometry.multiple_shock_vibration": "phonometry.vibration.multiple_shock_vibration", - "phonometry.transfer_stiffness": "phonometry.vibration.transfer_stiffness", + "phonometry.human_vibration": "phonometry.vibration.human.exposure", + "phonometry.mechanical_mobility": + "phonometry.vibration.structural.mechanical_mobility", + "phonometry.multiple_shock_vibration": + "phonometry.vibration.human.multiple_shock", + "phonometry.transfer_stiffness": + "phonometry.vibration.structural.transfer_stiffness", "phonometry.air_absorption": "phonometry.environmental.air_absorption", "phonometry.environmental_measurement": "phonometry.environmental.measurement", "phonometry.impulse_prominence": "phonometry.environmental.impulse_prominence", @@ -163,6 +168,23 @@ "phonometry.hearing.sii": "phonometry.speech.sii", "phonometry.hearing.objective_intelligibility": "phonometry.speech.objective_intelligibility", + "phonometry.vibration.mechanical_mobility": + "phonometry.vibration.structural.mechanical_mobility", + "phonometry.vibration.point_mobility": + "phonometry.vibration.structural.point_mobility", + "phonometry.vibration.junction_transmission": + "phonometry.vibration.structural.junction_transmission", + "phonometry.vibration.radiation_efficiency": + "phonometry.vibration.structural.radiation_efficiency", + "phonometry.vibration.experimental_sea": + "phonometry.vibration.structural.experimental_sea", + "phonometry.vibration.transfer_stiffness": + "phonometry.vibration.structural.transfer_stiffness", + "phonometry.vibration.human_vibration": "phonometry.vibration.human.exposure", + "phonometry.vibration.multiple_shock_vibration": + "phonometry.vibration.human.multiple_shock", + "phonometry.vibration.machine_diagnostics": + "phonometry.vibration.machinery.diagnostics", } #: The two generations, each with the release that deprecated it and the one @@ -203,11 +225,27 @@ def __dir__() -> list[str]: return shim +def _alias_modules(package: str) -> list[str]: + """Pre-split module names of ``package`` that only live in the table now. + + ``phonometry.vibration.human_vibration`` is registered in ``sys.modules`` + by :func:`_install`, which is enough for ``import`` but not for the dotted + read that follows it: the attribute is gone from the package. These are + the names :func:`_namespace_shim` has to serve and :func:`_namespace_dir` + has to list. + """ + prefix = f"{package}." + return sorted( + old.removeprefix(prefix) for old in _MOVED_4X + if old.startswith(prefix) and "." not in old.removeprefix(prefix) + ) + + def _namespace_shim( - package: str, targets: tuple[str, ...], *, + package: str, targets: tuple[str, ...] = (), *, since: str = "4.0", removed_in: str = "5.0" ) -> Callable[[str], Any]: - """Return a PEP 562 ``__getattr__`` for names that left ``package``. + """Return a PEP 562 ``__getattr__`` for what left ``package``. The 4.0 taxonomy moves public names between subpackage namespaces, and ``from phonometry import metrology`` followed by ``metrology.leq(...)`` is @@ -218,13 +256,17 @@ def _namespace_shim( and a function resolves to the function, as the pre-split package did: ``metrology.cepstrum`` is :func:`phonometry.signals.cepstrum`. - Only then does a name fall back to the module alias of the same name, - which is what serves the modules with no public name of their own - (``metrology.spectra``, ``metrology.levels``). The alias carries its own - notice on attribute access, so returning it here is silent. + Only then does a name fall back to the module alias of the same name. + That is what serves the modules with no public name of their own + (``metrology.spectra``, ``metrology.levels``) and the whole of a package + whose modules moved while its names stayed: ``vibration.human_vibration`` + is a module and never was a name, so ``targets`` is empty there and the + fallback is the only branch that fires. The alias carries its own notice + on attribute access, so returning it here is silent. :param package: The narrowed package, ``__name__`` of its ``__init__``. - :param targets: Packages the names moved to, in search order. + :param targets: Packages the names moved to, in search order. Empty when + only modules moved. :param since: Release that moved the names. :param removed_in: Major release that removes the alias. :return: The ``__getattr__`` to bind at module level. @@ -250,7 +292,8 @@ def __getattr__(name: str) -> Any: def _namespace_dir( - own: list[str] | tuple[str, ...], targets: tuple[str, ...] + package: str, own: list[str] | tuple[str, ...], + targets: tuple[str, ...] = () ) -> Callable[[], list[str]]: """Return a ``__dir__`` listing the names a narrowed package still serves. @@ -260,13 +303,14 @@ def _namespace_dir( narrow on purpose: ``from phonometry.metrology import *`` gives the 4.0 API, not the deprecated names. + :param package: The package, ``__name__`` of its ``__init__``. :param own: The package's own ``__all__``. :param targets: Packages the moved names went to. :return: The ``__dir__`` to bind at module level. """ def __dir__() -> list[str]: - names = set(own) + names = set(own) | set(_alias_modules(package)) for target in targets: names |= set(getattr(import_module(target), "__all__", ())) return sorted(names) diff --git a/src/phonometry/_plot/geometry.py b/src/phonometry/_plot/geometry.py index 8e661e9d4..b659938e5 100644 --- a/src/phonometry/_plot/geometry.py +++ b/src/phonometry/_plot/geometry.py @@ -59,8 +59,8 @@ from ..room.image_source import ImageSourceResult from ..room.open_plan import OpenPlanResult from ..simulation.fdtd import FDTD2D - from ..vibration.junction_transmission import JunctionTransmissionResult - from ..vibration.radiation_efficiency import RadiationEfficiencyResult + from ..vibration.structural.junction_transmission import JunctionTransmissionResult + from ..vibration.structural.radiation_efficiency import RadiationEfficiencyResult #: The ``ReactiveSilencerResult.kind`` strings, shared with the dispatcher. _KIND_EXPANSION = "expansion chamber" @@ -2622,7 +2622,7 @@ def plot_junction_geometry( Plate 1 runs horizontally; the perpendicular plate(s) of thickness 2 form the L, T or X. The incident bending wave arrives on plate 1 and the junction type follows - :func:`~phonometry.vibration.junction_transmission`. + :func:`~phonometry.vibration.structural.junction_transmission`. :param junction: ``"L"``, ``"T1"``, ``"T2"`` or ``"X"``. :param thickness1: Plate 1 thickness, in metres. diff --git a/src/phonometry/_plot/junction.py b/src/phonometry/_plot/junction.py index 97b7d41b5..52ee429a1 100644 --- a/src/phonometry/_plot/junction.py +++ b/src/phonometry/_plot/junction.py @@ -17,7 +17,7 @@ if TYPE_CHECKING: from matplotlib.axes import Axes - from ..vibration.junction_transmission import JunctionTransmissionResult + from ..vibration.structural.junction_transmission import JunctionTransmissionResult #: Spanish translations of the fixed strings rendered here, keyed by their #: verbatim English text. ``_t`` returns the English key unchanged for any @@ -54,7 +54,7 @@ def plot_junction_transmission( reference lines. :param result: A - :class:`~phonometry.vibration.junction_transmission.JunctionTransmissionResult`. + :class:`~phonometry.vibration.structural.junction_transmission.JunctionTransmissionResult`. :param ax: Existing axes, or ``None`` to create a figure. :param language: Label language, ``"en"`` (default) or ``"es"``. :param kwargs: Forwarded to the corner-curve ``plot``. diff --git a/src/phonometry/_plot/vibration.py b/src/phonometry/_plot/vibration.py index f8ab6a087..628fb246b 100644 --- a/src/phonometry/_plot/vibration.py +++ b/src/phonometry/_plot/vibration.py @@ -33,20 +33,20 @@ if TYPE_CHECKING: from matplotlib.axes import Axes - from ..vibration.experimental_sea import PowerInjectionResult - from ..vibration.human_vibration import ( + from ..vibration.human.exposure import ( DailyVibrationExposure, WeightedSpectrum, WeightingResponse, ) - from ..vibration.machine_diagnostics import FaultFrequencyResult - from ..vibration.mechanical_mobility import ( + from ..vibration.human.multiple_shock import MultipleShockResult + from ..vibration.machinery.diagnostics import FaultFrequencyResult + from ..vibration.structural.experimental_sea import PowerInjectionResult + from ..vibration.structural.mechanical_mobility import ( MobilityResult, RigidMassCalibrationResult, ) - from ..vibration.multiple_shock_vibration import MultipleShockResult - from ..vibration.radiation_efficiency import RadiationEfficiencyResult - from ..vibration.transfer_stiffness import TransferStiffnessResult + from ..vibration.structural.radiation_efficiency import RadiationEfficiencyResult + from ..vibration.structural.transfer_stiffness import TransferStiffnessResult #: Spanish translations of the fixed strings rendered by the vibration #: ``.plot()`` renderers, keyed by their verbatim English text. ``_t`` @@ -121,7 +121,7 @@ def plot_vibration_weighting( """Frequency-weighting factor (dB) versus frequency (ISO 8041-1). :param result: A - :class:`~phonometry.vibration.human_vibration.WeightingResponse` exposing + :class:`~phonometry.vibration.human.exposure.WeightingResponse` exposing ``name``, ``frequencies`` and ``magnitude_db``. :param ax: Existing axes, or ``None`` to create a figure. :param language: Label language, ``"en"`` (default) or ``"es"``. @@ -154,7 +154,7 @@ def plot_weighted_spectrum( contributions ``W_i*a_i``; the overall ``a_w`` is annotated in the title. :param result: A - :class:`~phonometry.vibration.human_vibration.WeightedSpectrum` exposing + :class:`~phonometry.vibration.human.exposure.WeightedSpectrum` exposing ``frequencies``, ``band_accelerations``, ``weighted``, ``overall`` and ``weighting_name``. :param ax: Existing axes, or ``None`` to create a figure. @@ -209,7 +209,7 @@ def plot_daily_exposure( ``A(8)`` bar, and the exposure action and limit value as horizontal lines. :param result: A - :class:`~phonometry.vibration.human_vibration.DailyVibrationExposure` exposing + :class:`~phonometry.vibration.human.exposure.DailyVibrationExposure` exposing ``labels``, ``partials``, ``a8`` and ``assessment``. :param ax: Existing axes, or ``None`` to create a figure. :param language: Label language, ``"en"`` (default) or ``"es"``. @@ -277,7 +277,7 @@ def plot_mobility( ) -> Axes: """Mobility magnitude ``|Y(f)|`` on log-log axes (ISO 7626-1). - :param result: A :class:`~phonometry.vibration.mechanical_mobility.MobilityResult`. + :param result: A :class:`~phonometry.vibration.structural.mechanical_mobility.MobilityResult`. :param ax: Existing axes, or ``None`` to create a figure. :param language: Label language, ``"en"`` (default) or ``"es"``. :param kwargs: Forwarded to the magnitude ``plot``. @@ -325,7 +325,7 @@ def plot_rigid_mass_calibration( two-axes array is returned. :param result: A - :class:`~phonometry.vibration.mechanical_mobility.RigidMassCalibrationResult`. + :class:`~phonometry.vibration.structural.mechanical_mobility.RigidMassCalibrationResult`. :param ax: Existing axes for the deviation panel, or ``None`` for a fresh two-panel figure. :param language: Label language, ``"en"`` (default) or ``"es"``. @@ -413,7 +413,7 @@ def plot_transfer_stiffness( ) -> Axes: """Dynamic transfer stiffness level ``L_k(f)`` on a log-frequency axis. - :param result: A :class:`~phonometry.vibration.transfer_stiffness.TransferStiffnessResult`. + :param result: A :class:`~phonometry.vibration.structural.transfer_stiffness.TransferStiffnessResult`. :param ax: Existing axes, or ``None`` to create a figure. :param language: Label language, ``"en"`` (default) or ``"es"``. :param kwargs: Forwarded to the level ``plot``. @@ -443,7 +443,7 @@ def plot_radiation_efficiency( """Radiation efficiency ``sigma(f)`` on log-log axes (Hopkins 2.9.4). :param result: A - :class:`~phonometry.vibration.radiation_efficiency.RadiationEfficiencyResult`. + :class:`~phonometry.vibration.structural.radiation_efficiency.RadiationEfficiencyResult`. :param ax: Existing axes, or ``None`` to create a figure. :param language: Label language, ``"en"`` (default) or ``"es"``. :param kwargs: Forwarded to the ``sigma`` curve ``plot``. @@ -482,14 +482,14 @@ def plot_multiple_shock( ) -> Axes: """Injury-probability curve ``P(R)`` with this assessment's ``R`` marked. - :param result: A :class:`~phonometry.vibration.multiple_shock_vibration.MultipleShockResult`. + :param result: A :class:`~phonometry.vibration.human.multiple_shock.MultipleShockResult`. :param ax: Existing axes, or ``None`` to create a figure. :param language: Label language, ``"en"`` (default) or ``"es"``. :param kwargs: Forwarded to the ``R`` marker ``scatter``. :return: The axes. """ from .._i18n import format_number, localize_axes - from ..vibration.multiple_shock_vibration import injury_probability + from ..vibration.human.multiple_shock import injury_probability ax = ax if ax is not None else _new_axes() r10, r50, r90 = result.risk_thresholds @@ -654,7 +654,7 @@ def plot_fault_frequencies( a named line, which is what the overlay makes readable. :param result: A - :class:`~phonometry.vibration.machine_diagnostics.FaultFrequencyResult`. + :class:`~phonometry.vibration.machinery.diagnostics.FaultFrequencyResult`. :param ax: Existing axes, or ``None`` to create a figure. :param language: Label language, ``"en"`` (default) or ``"es"``. :param spectrum: Measured spectrum to draw underneath: an @@ -716,7 +716,7 @@ def plot_power_injection( diagnosis. :param result: A - :class:`~phonometry.vibration.experimental_sea.PowerInjectionResult`. + :class:`~phonometry.vibration.structural.experimental_sea.PowerInjectionResult`. :param ax: Existing axes, or ``None`` to create a figure. :param language: Label language, ``"en"`` (default) or ``"es"``. :param kwargs: Forwarded to the ``eta_12`` curve. diff --git a/src/phonometry/_report/human_vibration.py b/src/phonometry/_report/human_vibration.py index 65a66fcf7..be0e8b98d 100644 --- a/src/phonometry/_report/human_vibration.py +++ b/src/phonometry/_report/human_vibration.py @@ -2,7 +2,7 @@ """Daily vibration exposure assessment fiche (reportlab renderer). Renders a -:class:`~phonometry.vibration.human_vibration.DailyVibrationExposure` to a +:class:`~phonometry.vibration.human.exposure.DailyVibrationExposure` to a one-page PDF laid out like a hand-arm / whole-body vibration exposure assessment sheet (the layout the HSE exposure calculators and the EU Good Practice Guides use): each operation's vibration magnitude and daily @@ -70,7 +70,7 @@ from .metadata import ReportMetadata if TYPE_CHECKING: - from ..vibration.human_vibration import DailyVibrationExposure + from ..vibration.human.exposure import DailyVibrationExposure #: Number of decimal places the fiche displays vibration magnitudes at. Two #: decimals resolve the whole-body ELV (1.15 m/s2) and the small whole-body @@ -246,7 +246,7 @@ def _assessment_rows( evaluated on ``A(8)`` rounded exactly as the fiche displays it, so the printed numbers can never contradict their own status at a threshold boundary; the ``>=`` (reaches or exceeds) direction matches the - :class:`~phonometry.vibration.human_vibration.ExposureAssessment`. + :class:`~phonometry.vibration.human.exposure.ExposureAssessment`. """ assessment = result.assessment metric = str(assessment.metric) @@ -342,7 +342,7 @@ def _verdict(result: DailyVibrationExposure, language: str = "en") -> tuple[str, exposure action value is an obligation trigger reported in the assessment table. The comparison uses the displayed value and the same reaches-or- exceeds (``>=``) direction as the assessment rows and the - :class:`~phonometry.vibration.human_vibration.ExposureAssessment`, so the + :class:`~phonometry.vibration.human.exposure.ExposureAssessment`, so the verdict never contradicts the ELV row it sits beside. """ assessment = result.assessment @@ -378,8 +378,8 @@ def render_human_vibration_report( """Render a daily vibration exposure assessment fiche to a PDF at ``path``. :param result: A - :class:`~phonometry.vibration.human_vibration.DailyVibrationExposure` - (from :func:`~phonometry.vibration.human_vibration.daily_vibration_exposure`). + :class:`~phonometry.vibration.human.exposure.DailyVibrationExposure` + (from :func:`~phonometry.vibration.human.exposure.daily_vibration_exposure`). :param path: Destination path of the PDF file. :param metadata: Optional :class:`ReportMetadata` supplying the header identity (``client`` is the company, ``specimen`` the operator/worker, diff --git a/src/phonometry/_report/iso10846.py b/src/phonometry/_report/iso10846.py index 7e72bddfd..6e4ab1c09 100644 --- a/src/phonometry/_report/iso10846.py +++ b/src/phonometry/_report/iso10846.py @@ -2,7 +2,7 @@ """ISO 10846 dynamic-transfer-stiffness fiche (reportlab renderer). Renders a -:class:`~phonometry.vibration.transfer_stiffness.TransferStiffnessResult` to a +:class:`~phonometry.vibration.structural.transfer_stiffness.TransferStiffnessResult` to a one-page PDF laid out like a dynamic-transfer-stiffness characterisation report for a resilient element (a vibration isolator, mount, bellows or hose) per ISO 10846-1:2008 (the transfer-stiffness definition, 3.7), determined by either @@ -44,7 +44,7 @@ from .metadata import ReportMetadata if TYPE_CHECKING: - from ..vibration.transfer_stiffness import TransferStiffnessResult + from ..vibration.structural.transfer_stiffness import TransferStiffnessResult def _is_indirect(result: TransferStiffnessResult) -> bool: @@ -168,7 +168,7 @@ def render_transfer_stiffness_report( """Render an ISO 10846 dynamic-transfer-stiffness fiche to a PDF at ``path``. :param result: A - :class:`~phonometry.vibration.transfer_stiffness.TransferStiffnessResult` + :class:`~phonometry.vibration.structural.transfer_stiffness.TransferStiffnessResult` carrying the complex ``k2,1(f)`` and, for the indirect method, the blocking mass used. :param path: Destination path of the PDF file. diff --git a/src/phonometry/_report/iso2631_5.py b/src/phonometry/_report/iso2631_5.py index 9c0a6168d..b689a6124 100644 --- a/src/phonometry/_report/iso2631_5.py +++ b/src/phonometry/_report/iso2631_5.py @@ -2,7 +2,7 @@ """Whole-body multiple-shock health-risk fiche (reportlab renderer). Renders a -:class:`~phonometry.vibration.multiple_shock_vibration.MultipleShockResult` to a +:class:`~phonometry.vibration.human.multiple_shock.MultipleShockResult` to a one-page PDF laid out like a whole-body multiple-shock health-risk assessment sheet (ISO 2631-5:2018, the normative Clause 5 spinal-response dose and the Annex C assessment of adverse health effects): @@ -63,7 +63,7 @@ from .metadata import ReportMetadata if TYPE_CHECKING: - from ..vibration.multiple_shock_vibration import MultipleShockResult + from ..vibration.human.multiple_shock import MultipleShockResult #: Display precision of the acceleration dose and compressive stress (two #: decimals resolve the Annex C worked example Dz = 55.97 m/s2 and Sd = 1.62 @@ -377,9 +377,9 @@ def render_iso2631_5_report( """Render a whole-body multiple-shock health-risk fiche to a PDF at ``path``. :param result: A - :class:`~phonometry.vibration.multiple_shock_vibration.MultipleShockResult` + :class:`~phonometry.vibration.human.multiple_shock.MultipleShockResult` (from - :func:`~phonometry.vibration.multiple_shock_vibration.multiple_shock_assessment`). + :func:`~phonometry.vibration.human.multiple_shock.multiple_shock_assessment`). :param path: Destination path of the PDF file. :param metadata: Optional :class:`ReportMetadata` supplying the header identity (``client``, ``specimen`` the subject, ``test_room`` the diff --git a/src/phonometry/_report/iso7626.py b/src/phonometry/_report/iso7626.py index 84c2f27c7..84a314cf8 100644 --- a/src/phonometry/_report/iso7626.py +++ b/src/phonometry/_report/iso7626.py @@ -2,7 +2,7 @@ """ISO 7626 mechanical-mobility fiche (reportlab renderer). Renders a -:class:`~phonometry.vibration.mechanical_mobility.MobilityResult` to a one-page +:class:`~phonometry.vibration.structural.mechanical_mobility.MobilityResult` to a one-page PDF laid out like a mechanical-mobility measurement report (ISO 7626-1:2011 for the frequency-response-function definitions, ISO 7626-2:2015 for the measurement): @@ -42,7 +42,7 @@ from .metadata import ReportMetadata if TYPE_CHECKING: - from ..vibration.mechanical_mobility import MobilityResult + from ..vibration.structural.mechanical_mobility import MobilityResult #: The mobility unit, m/(N.s), as reportlab markup (a middle dot, not a hyphen). _MOBILITY_UNIT = "m/(N·s)" @@ -149,7 +149,7 @@ def render_mobility_report( """Render an ISO 7626 mechanical-mobility fiche to a PDF at ``path``. :param result: A - :class:`~phonometry.vibration.mechanical_mobility.MobilityResult` + :class:`~phonometry.vibration.structural.mechanical_mobility.MobilityResult` carrying the complex mobility ``Y(f)`` and whether it is a driving-point FRF. :param path: Destination path of the PDF file. diff --git a/src/phonometry/building/installed_structure_borne.py b/src/phonometry/building/installed_structure_borne.py index deb13ee29..794d5144c 100644 --- a/src/phonometry/building/installed_structure_borne.py +++ b/src/phonometry/building/installed_structure_borne.py @@ -45,7 +45,7 @@ (Formula 17). The source and receiver mobilities/impedances are those of -:mod:`phonometry.vibration.mechanical_mobility` and :mod:`phonometry.vibration.transfer_stiffness`. +:mod:`phonometry.vibration.structural.mechanical_mobility` and :mod:`phonometry.vibration.structural.transfer_stiffness`. """ from __future__ import annotations diff --git a/src/phonometry/building/masonry_cavity_wall.py b/src/phonometry/building/masonry_cavity_wall.py index f295a6de0..09af5c0b2 100644 --- a/src/phonometry/building/masonry_cavity_wall.py +++ b/src/phonometry/building/masonry_cavity_wall.py @@ -85,7 +85,7 @@ from numpy.typing import ArrayLike from .._internal.validation import require_finite_array, require_positive -from ..vibration.point_mobility import infinite_plate_mobility +from ..vibration.structural.point_mobility import infinite_plate_mobility if TYPE_CHECKING: from matplotlib.axes import Axes @@ -231,7 +231,7 @@ def wall_tie_coupling_loss_factor( :param mass2: Surface density ``rho_s2`` of the receiving leaf, in kg/m^2 (> 0). :param bending_stiffness1: Bending stiffness per unit width ``B'`` of leaf 1, in N.m (> 0); see - :func:`phonometry.vibration.point_mobility.plate_bending_stiffness`. + :func:`phonometry.vibration.structural.point_mobility.plate_bending_stiffness`. :param bending_stiffness2: Bending stiffness per unit width of leaf 2, in N.m. :param ties_per_area: Number of ties per unit area ``n``, in 1/m^2 (> 0). :param tie: A name from :data:`WALL_TIE_STIFFNESS`, an explicit dynamic diff --git a/src/phonometry/building/panel_transmission.py b/src/phonometry/building/panel_transmission.py index 36dfb865a..187937302 100644 --- a/src/phonometry/building/panel_transmission.py +++ b/src/phonometry/building/panel_transmission.py @@ -100,7 +100,7 @@ require_non_negative, require_positive, ) -from ..vibration.radiation_efficiency import coincidence_frequency +from ..vibration.structural.radiation_efficiency import coincidence_frequency if TYPE_CHECKING: from matplotlib.axes import Axes @@ -381,7 +381,7 @@ def single_panel_transmission_loss( Provide the coincidence frequency directly through *critical_frequency*, or let it be computed from *bending_stiffness* and *mass_per_area* through - :func:`~phonometry.vibration.radiation_efficiency.coincidence_frequency`. + :func:`~phonometry.vibration.structural.radiation_efficiency.coincidence_frequency`. :param frequency: Band centre frequencies ``f``, in hertz (array, > 0). :param mass_per_area: Mass per unit area ``m''``, in kg/m^2 (> 0). @@ -789,7 +789,7 @@ def orthotropic_critical_frequencies( :math:`f_c = \frac{c_0^{2}}{2 \pi} \sqrt{m'' / B}` evaluated for both principal bending stiffnesses (Vigran Eq. (6.107), printed p. 252; the same closed form as the isotropic - :func:`~phonometry.vibration.radiation_efficiency.coincidence_frequency`). + :func:`~phonometry.vibration.structural.radiation_efficiency.coincidence_frequency`). The stiffest direction gives the **lowest** coincidence frequency, so the returned pair is sorted: ``fc1`` from the larger stiffness, ``fc2`` from the smaller. For a corrugated sheet ``fc1`` can sit at a few hundred hertz while diff --git a/src/phonometry/hearing/__init__.py b/src/phonometry/hearing/__init__.py index c23058646..44f07095c 100644 --- a/src/phonometry/hearing/__init__.py +++ b/src/phonometry/hearing/__init__.py @@ -72,4 +72,4 @@ #: ``__getattr__`` is invisible to ``dir()``; keep the moved names listed #: while they still resolve. -__dir__ = _namespace_dir(__all__, _MOVED_TO) +__dir__ = _namespace_dir(__name__, __all__, _MOVED_TO) diff --git a/src/phonometry/metrology/__init__.py b/src/phonometry/metrology/__init__.py index 8cab4a3d6..8b0bf1eb2 100644 --- a/src/phonometry/metrology/__init__.py +++ b/src/phonometry/metrology/__init__.py @@ -79,4 +79,4 @@ #: ``__getattr__`` is invisible to ``dir()``; keep the moved names listed #: while they still resolve. -__dir__ = _namespace_dir(__all__, _MOVED_TO) +__dir__ = _namespace_dir(__name__, __all__, _MOVED_TO) diff --git a/src/phonometry/vibration/__init__.py b/src/phonometry/vibration/__init__.py index f71a5df40..e4b1331fb 100644 --- a/src/phonometry/vibration/__init__.py +++ b/src/phonometry/vibration/__init__.py @@ -1,22 +1,21 @@ # Copyright (c) 2026. Jose Manuel Requena Plens -"""vibration domain of phonometry (see module docstrings).""" +"""vibration domain of phonometry (see module docstrings). + +Three families since 4.0, by who reads them: :mod:`~phonometry.vibration.structural` +is the structural acoustics that feeds building prediction (mobility, junctions, +radiation, SEA), :mod:`~phonometry.vibration.human` is exposure of people +(ISO 2631, ISO 5349) and :mod:`~phonometry.vibration.machinery` is condition +monitoring. Every public name is still exported here, so +``from phonometry import vibration`` reads exactly as it did. +""" from __future__ import annotations +from .._compat import _namespace_dir, _namespace_shim from .._plot.geometry import ( plot_plate_geometry, ) -from .experimental_sea import ( - PowerInjectionResult, - bar_modal_density, - beam_modal_density, - cylindrical_shell_modal_density, - flat_plate_modal_density, - power_injection_clf, - power_injection_matrix, - ring_frequency, -) -from .human_vibration import ( +from .human import ( HAV_EAV_A8, HAV_ELV_A8, REFERENCE_ACCELERATION, @@ -29,42 +28,43 @@ DailyVibrationExposure, ExposureAssessment, HumanVibrationWarning, + MultipleShockResult, WeightedSpectrum, WeightingResponse, + acceleration_dose, apply_weighting, combine_partial_exposures, + compression_dose, crest_factor, + daily_dose, + daily_dose_multi, daily_exposure, daily_vibration_exposure, + dose_from_peaks, energy_equivalent_acceleration, exposure_assessment, frequency_weighting, hav_daily_exposure, hav_vwf_lifetime_years, + injury_probability, + injury_risk, motion_sickness_dose_value, mtvv, + multiple_shock_assessment, partial_exposure, + response_peaks, running_rms, + seat_to_spine_transfer, + spinal_response, + static_stress, + ultimate_strength, vibration_dose_value, vibration_total_value, wbv_exposure_basis, weighted_acceleration, weighting_factors, ) -from .junction_transmission import ( - JunctionTransmissionResult, - angular_average_transmission_coefficient, - corner_transmission_coefficient, - coupling_loss_factor, - inline_transmission_coefficient, - junction_transmission, - junction_wave_parameters, - point_connection_coupling_loss_factor, - right_angle_transmission_coefficient, - straight_transmission_coefficient, - wave_vibration_reduction_index, -) -from .machine_diagnostics import ( +from .machinery import ( FaultFrequencyResult, FaultLine, bearing_fault_frequencies, @@ -74,37 +74,29 @@ induction_motor_frequencies, shaft_rate, ) -from .mechanical_mobility import ( +from .structural import ( FRF_UNITS, + REFERENCE_STIFFNESS, + TRANSMISSIBILITY_LIMIT, + JunctionTransmissionResult, MobilityResult, + PowerInjectionResult, + RadiationEfficiencyResult, RigidMassCalibrationResult, - convert_frf, - random_error_percent, - resonance_frequency, - rigid_mass_calibration_check, - sdof_accelerance, - sdof_mobility, - sdof_mobility_result, - sdof_receptance, -) -from .multiple_shock_vibration import ( - MultipleShockResult, - acceleration_dose, - compression_dose, - daily_dose, - daily_dose_multi, - dose_from_peaks, - injury_probability, - injury_risk, - multiple_shock_assessment, - response_peaks, - seat_to_spine_transfer, - spinal_response, - static_stress, - ultimate_strength, -) -from .point_mobility import ( + TransferStiffnessResult, + angular_average_transmission_coefficient, + bar_modal_density, + base_transmissibility, beam_bending_wave_speed, + beam_modal_density, + blocking_force_ratio, + coincidence_frequency, + convert_frf, + corner_transmission_coefficient, + coupling_loss_factor, + cylindrical_shell_modal_density, + flat_plate_modal_density, + indirect_transfer_stiffness_result, infinite_beam_impedance, infinite_beam_mobility, infinite_beam_moment_mobility, @@ -113,27 +105,32 @@ infinite_plate_mobility, infinite_plate_point_mobility, injected_power, + inline_transmission_coefficient, + junction_transmission, + junction_wave_parameters, longitudinal_rod_impedance, longitudinal_rod_mobility, + loss_factor, plate_bending_stiffness, plate_bending_wave_speed, -) -from .radiation_efficiency import ( - RadiationEfficiencyResult, - coincidence_frequency, + point_connection_coupling_loss_factor, + power_injection_clf, + power_injection_matrix, radiation_efficiency, -) -from .transfer_stiffness import ( - REFERENCE_STIFFNESS, - TRANSMISSIBILITY_LIMIT, - TransferStiffnessResult, - base_transmissibility, - blocking_force_ratio, - indirect_transfer_stiffness_result, - loss_factor, + random_error_percent, + resonance_frequency, + right_angle_transmission_coefficient, + rigid_mass_calibration_check, + ring_frequency, + sdof_accelerance, + sdof_mobility, + sdof_mobility_result, + sdof_receptance, + straight_transmission_coefficient, transfer_stiffness_direct, transfer_stiffness_indirect, transfer_stiffness_level, + wave_vibration_reduction_index, ) __all__ = [ @@ -250,3 +247,9 @@ "weighted_acceleration", "weighting_factors", ] + +#: No public name left this namespace in 4.0, but the modules did, so +#: ``vibration.human_vibration`` has to keep resolving to its alias module +#: until 5.0: the import registers it, the attribute read needs this. +__getattr__ = _namespace_shim(__name__) +__dir__ = _namespace_dir(__name__, __all__) diff --git a/src/phonometry/vibration/human/__init__.py b/src/phonometry/vibration/human/__init__.py new file mode 100644 index 000000000..ced9e3382 --- /dev/null +++ b/src/phonometry/vibration/human/__init__.py @@ -0,0 +1,106 @@ +# Copyright (c) 2026. Jose Manuel Requena Plens +"""vibration.human subdomain of phonometry: human exposure to vibration (ISO 2631, ISO 5349).""" + +from __future__ import annotations + +from .exposure import ( + HAV_EAV_A8, + HAV_ELV_A8, + REFERENCE_ACCELERATION, + REFERENCE_DURATION_S, + WBV_EAV_A8, + WBV_EAV_VDV, + WBV_ELV_A8, + WBV_ELV_VDV, + WEIGHTING_NAMES, + DailyVibrationExposure, + ExposureAssessment, + HumanVibrationWarning, + WeightedSpectrum, + WeightingResponse, + apply_weighting, + combine_partial_exposures, + crest_factor, + daily_exposure, + daily_vibration_exposure, + energy_equivalent_acceleration, + exposure_assessment, + frequency_weighting, + hav_daily_exposure, + hav_vwf_lifetime_years, + motion_sickness_dose_value, + mtvv, + partial_exposure, + running_rms, + vibration_dose_value, + vibration_total_value, + wbv_exposure_basis, + weighted_acceleration, + weighting_factors, +) +from .multiple_shock import ( + MultipleShockResult, + acceleration_dose, + compression_dose, + daily_dose, + daily_dose_multi, + dose_from_peaks, + injury_probability, + injury_risk, + multiple_shock_assessment, + response_peaks, + seat_to_spine_transfer, + spinal_response, + static_stress, + ultimate_strength, +) + +__all__ = [ + "HAV_EAV_A8", + "HAV_ELV_A8", + "REFERENCE_ACCELERATION", + "REFERENCE_DURATION_S", + "WBV_EAV_A8", + "WBV_EAV_VDV", + "WBV_ELV_A8", + "WBV_ELV_VDV", + "WEIGHTING_NAMES", + "DailyVibrationExposure", + "ExposureAssessment", + "HumanVibrationWarning", + "MultipleShockResult", + "WeightedSpectrum", + "WeightingResponse", + "acceleration_dose", + "apply_weighting", + "combine_partial_exposures", + "compression_dose", + "crest_factor", + "daily_dose", + "daily_dose_multi", + "daily_exposure", + "daily_vibration_exposure", + "dose_from_peaks", + "energy_equivalent_acceleration", + "exposure_assessment", + "frequency_weighting", + "hav_daily_exposure", + "hav_vwf_lifetime_years", + "injury_probability", + "injury_risk", + "motion_sickness_dose_value", + "mtvv", + "multiple_shock_assessment", + "partial_exposure", + "response_peaks", + "running_rms", + "seat_to_spine_transfer", + "spinal_response", + "static_stress", + "ultimate_strength", + "vibration_dose_value", + "vibration_total_value", + "wbv_exposure_basis", + "weighted_acceleration", + "weighting_factors", +] diff --git a/src/phonometry/vibration/human_vibration.py b/src/phonometry/vibration/human/exposure.py similarity index 98% rename from src/phonometry/vibration/human_vibration.py rename to src/phonometry/vibration/human/exposure.py index c9cfb4bc9..7288be9b0 100644 --- a/src/phonometry/vibration/human_vibration.py +++ b/src/phonometry/vibration/human/exposure.py @@ -62,13 +62,13 @@ from numpy.typing import ArrayLike, NDArray from scipy import signal as sig -from .._internal.types import Real -from .._internal.warnings import PhonometryWarning +from ..._internal.types import Real +from ..._internal.warnings import PhonometryWarning if TYPE_CHECKING: # pragma: no cover - typing only from matplotlib.axes import Axes - from .._report.metadata import ReportMetadata + from ..._report.metadata import ReportMetadata Complex = NDArray[np.complex128] @@ -289,8 +289,8 @@ def plot(self, ax: Axes | None = None, *, language: str = "en", **kwargs: Any) - Requires matplotlib (``pip install phonometry[plot]``); returns the :class:`~matplotlib.axes.Axes` and never calls ``plt.show``. """ - from .._i18n import check_language - from .._plot.vibration import plot_vibration_weighting + from ..._i18n import check_language + from ..._plot.vibration import plot_vibration_weighting return plot_vibration_weighting(self, ax=ax, language=check_language(language), **kwargs) @@ -391,8 +391,8 @@ def plot(self, ax: Axes | None = None, *, language: str = "en", **kwargs: Any) - Requires matplotlib (``pip install phonometry[plot]``); returns the :class:`~matplotlib.axes.Axes` and never calls ``plt.show``. """ - from .._i18n import check_language - from .._plot.vibration import plot_weighted_spectrum + from ..._i18n import check_language + from ..._plot.vibration import plot_weighted_spectrum return plot_weighted_spectrum(self, ax=ax, language=check_language(language), **kwargs) @@ -864,8 +864,8 @@ def plot(self, ax: Axes | None = None, *, language: str = "en", **kwargs: Any) - Requires matplotlib (``pip install phonometry[plot]``); returns the :class:`~matplotlib.axes.Axes` and never calls ``plt.show``. """ - from .._i18n import check_language - from .._plot.vibration import plot_daily_exposure + from ..._i18n import check_language + from ..._plot.vibration import plot_daily_exposure return plot_daily_exposure(self, ax=ax, language=check_language(language), **kwargs) @@ -915,14 +915,14 @@ def report( fiche always embeds the contribution chart, so both are required (``pip install "phonometry[report,plot]"``). """ - from .._i18n import check_language + from ..._i18n import check_language check_language(language) if engine != "reportlab": raise ValueError( f"Unknown report engine {engine!r}; only 'reportlab' is supported." ) - from .._report.human_vibration import render_human_vibration_report + from ..._report.human_vibration import render_human_vibration_report return render_human_vibration_report( self, path, metadata=metadata, verbose=verbose, language=language diff --git a/src/phonometry/vibration/multiple_shock_vibration.py b/src/phonometry/vibration/human/multiple_shock.py similarity index 96% rename from src/phonometry/vibration/multiple_shock_vibration.py rename to src/phonometry/vibration/human/multiple_shock.py index e71aa3b61..d0e3f73cf 100644 --- a/src/phonometry/vibration/multiple_shock_vibration.py +++ b/src/phonometry/vibration/human/multiple_shock.py @@ -66,14 +66,14 @@ import numpy as np -from .._internal.types import as_float_or_array -from .._internal.validation import require_1d_signal, require_choice, require_positive -from ..hearing.threshold import SEXES as _SEXES +from ..._internal.types import as_float_or_array +from ..._internal.validation import require_1d_signal, require_choice, require_positive +from ...hearing.threshold import SEXES as _SEXES if TYPE_CHECKING: from matplotlib.axes import Axes - from .._report.metadata import ReportMetadata + from ..._report.metadata import ReportMetadata from numpy.typing import ArrayLike @@ -205,7 +205,7 @@ def response_peaks(response: ArrayLike) -> np.ndarray: positive = np.empty(sig.size + 2, dtype=bool) positive[0] = positive[-1] = False positive[1:-1] = sig > 0.0 - starts = np.where(~positive[:-1] & positive[1:])[0] + starts = np.nonzero(~positive[:-1] & positive[1:])[0] if starts.size == 0: return np.array([], dtype=np.float64) return np.maximum.reduceat(sig, starts) @@ -252,7 +252,9 @@ def daily_dose(dose: float, exposure_time: float, measurement_time: float) -> fl was measured (same unit as ``exposure_time``). :return: The daily dose :math:`D_{zd} = D_z (t_d/t_m)^{1/6}`, m/s2. """ - if not measurement_time > 0.0 or not exposure_time > 0.0: + # Negated ">" rather than "<=" on purpose: it rejects NaN as well, which + # the opposite operator would let through. + if not measurement_time > 0.0 or not exposure_time > 0.0: # NOSONAR - NaN raise ValueError("exposure_time and measurement_time must be positive.") return float(dose * (exposure_time / measurement_time) ** (1.0 / DOSE_EXPONENT)) @@ -356,7 +358,8 @@ def injury_risk( require_choice(sex, "sex", _SEXES) if years <= 0: raise ValueError("years must be a positive integer.") - if not days_per_year > 0.0: + # Negated ">" rather than "<=" on purpose: it rejects NaN as well. + if not days_per_year > 0.0: # NOSONAR - NaN raise ValueError("days_per_year must be positive.") mz = _mz_for_sex(sex) if mz is None else mz s_stat = static_stress(mz) @@ -433,8 +436,8 @@ def plot(self, ax: Axes | None = None, *, language: str = "en", **kwargs: Any) - Requires matplotlib (``pip install phonometry[plot]``); returns the :class:`~matplotlib.axes.Axes`. """ - from .._i18n import check_language - from .._plot.vibration import plot_multiple_shock + from ..._i18n import check_language + from ..._plot.vibration import plot_multiple_shock return plot_multiple_shock(self, ax=ax, language=check_language(language), **kwargs) @@ -490,14 +493,14 @@ def report( fiche always embeds the injury-probability chart, so both are required (``pip install "phonometry[report,plot]"``). """ - from .._i18n import check_language + from ..._i18n import check_language check_language(language) if engine != "reportlab": raise ValueError( f"Unknown report engine {engine!r}; only 'reportlab' is supported." ) - from .._report.iso2631_5 import render_iso2631_5_report + from ..._report.iso2631_5 import render_iso2631_5_report return render_iso2631_5_report( self, path, metadata=metadata, verbose=verbose, language=language diff --git a/src/phonometry/vibration/machinery/__init__.py b/src/phonometry/vibration/machinery/__init__.py new file mode 100644 index 000000000..f121863ea --- /dev/null +++ b/src/phonometry/vibration/machinery/__init__.py @@ -0,0 +1,26 @@ +# Copyright (c) 2026. Jose Manuel Requena Plens +"""vibration.machinery subdomain of phonometry: machinery condition monitoring.""" + +from __future__ import annotations + +from .diagnostics import ( + FaultFrequencyResult, + FaultLine, + bearing_fault_frequencies, + blade_pass_frequencies, + combine_fault_lines, + gear_mesh_frequencies, + induction_motor_frequencies, + shaft_rate, +) + +__all__ = [ + "FaultFrequencyResult", + "FaultLine", + "bearing_fault_frequencies", + "blade_pass_frequencies", + "combine_fault_lines", + "gear_mesh_frequencies", + "induction_motor_frequencies", + "shaft_rate", +] diff --git a/src/phonometry/vibration/machine_diagnostics.py b/src/phonometry/vibration/machinery/diagnostics.py similarity index 99% rename from src/phonometry/vibration/machine_diagnostics.py rename to src/phonometry/vibration/machinery/diagnostics.py index 56c2dfb6a..378ab7e7b 100644 --- a/src/phonometry/vibration/machine_diagnostics.py +++ b/src/phonometry/vibration/machinery/diagnostics.py @@ -97,7 +97,7 @@ import numpy as np -from .._internal.validation import ( +from ..._internal.validation import ( require_choice, require_non_negative, require_positive, @@ -281,8 +281,8 @@ def plot( to the spectrum curve; see :func:`phonometry._plot.vibration.plot_fault_frequencies`. """ - from .._i18n import check_language - from .._plot.vibration import plot_fault_frequencies + from ..._i18n import check_language + from ..._plot.vibration import plot_fault_frequencies check_language(language) return plot_fault_frequencies(self, ax=ax, language=language, **kwargs) diff --git a/src/phonometry/vibration/structural/__init__.py b/src/phonometry/vibration/structural/__init__.py new file mode 100644 index 000000000..598f90848 --- /dev/null +++ b/src/phonometry/vibration/structural/__init__.py @@ -0,0 +1,132 @@ +# Copyright (c) 2026. Jose Manuel Requena Plens +"""vibration.structural subdomain of phonometry: structural vibration: mobility, junctions, radiation and SEA.""" + +from __future__ import annotations + +from .experimental_sea import ( + PowerInjectionResult, + bar_modal_density, + beam_modal_density, + cylindrical_shell_modal_density, + flat_plate_modal_density, + power_injection_clf, + power_injection_matrix, + ring_frequency, +) +from .junction_transmission import ( + JunctionTransmissionResult, + angular_average_transmission_coefficient, + corner_transmission_coefficient, + coupling_loss_factor, + inline_transmission_coefficient, + junction_transmission, + junction_wave_parameters, + point_connection_coupling_loss_factor, + right_angle_transmission_coefficient, + straight_transmission_coefficient, + wave_vibration_reduction_index, +) +from .mechanical_mobility import ( + FRF_UNITS, + MobilityResult, + RigidMassCalibrationResult, + convert_frf, + random_error_percent, + resonance_frequency, + rigid_mass_calibration_check, + sdof_accelerance, + sdof_mobility, + sdof_mobility_result, + sdof_receptance, +) +from .point_mobility import ( + beam_bending_wave_speed, + infinite_beam_impedance, + infinite_beam_mobility, + infinite_beam_moment_mobility, + infinite_beam_point_mobility, + infinite_plate_impedance, + infinite_plate_mobility, + infinite_plate_point_mobility, + injected_power, + longitudinal_rod_impedance, + longitudinal_rod_mobility, + plate_bending_stiffness, + plate_bending_wave_speed, +) +from .radiation_efficiency import ( + RadiationEfficiencyResult, + coincidence_frequency, + radiation_efficiency, +) +from .transfer_stiffness import ( + REFERENCE_STIFFNESS, + TRANSMISSIBILITY_LIMIT, + TransferStiffnessResult, + base_transmissibility, + blocking_force_ratio, + indirect_transfer_stiffness_result, + loss_factor, + transfer_stiffness_direct, + transfer_stiffness_indirect, + transfer_stiffness_level, +) + +__all__ = [ + "FRF_UNITS", + "REFERENCE_STIFFNESS", + "TRANSMISSIBILITY_LIMIT", + "JunctionTransmissionResult", + "MobilityResult", + "PowerInjectionResult", + "RadiationEfficiencyResult", + "RigidMassCalibrationResult", + "TransferStiffnessResult", + "angular_average_transmission_coefficient", + "bar_modal_density", + "base_transmissibility", + "beam_bending_wave_speed", + "beam_modal_density", + "blocking_force_ratio", + "coincidence_frequency", + "convert_frf", + "corner_transmission_coefficient", + "coupling_loss_factor", + "cylindrical_shell_modal_density", + "flat_plate_modal_density", + "indirect_transfer_stiffness_result", + "infinite_beam_impedance", + "infinite_beam_mobility", + "infinite_beam_moment_mobility", + "infinite_beam_point_mobility", + "infinite_plate_impedance", + "infinite_plate_mobility", + "infinite_plate_point_mobility", + "injected_power", + "inline_transmission_coefficient", + "junction_transmission", + "junction_wave_parameters", + "longitudinal_rod_impedance", + "longitudinal_rod_mobility", + "loss_factor", + "plate_bending_stiffness", + "plate_bending_wave_speed", + "point_connection_coupling_loss_factor", + "power_injection_clf", + "power_injection_matrix", + "radiation_efficiency", + "random_error_percent", + "resonance_frequency", + "right_angle_transmission_coefficient", + "rigid_mass_calibration_check", + "ring_frequency", + "sdof_accelerance", + "sdof_mobility", + "sdof_mobility_result", + "sdof_receptance", + "straight_transmission_coefficient", + "transfer_stiffness_direct", + "transfer_stiffness_indirect", + "transfer_stiffness_level", + "wave_vibration_reduction_index", +] diff --git a/src/phonometry/vibration/experimental_sea.py b/src/phonometry/vibration/structural/experimental_sea.py similarity index 98% rename from src/phonometry/vibration/experimental_sea.py rename to src/phonometry/vibration/structural/experimental_sea.py index 7bfdc99fa..738118622 100644 --- a/src/phonometry/vibration/experimental_sea.py +++ b/src/phonometry/vibration/structural/experimental_sea.py @@ -6,9 +6,9 @@ Statistical energy analysis (SEA) has two routes to the coupling loss factor ``eta_ij``. The **predictive** route derives it from a wave transmission coefficient at the junction, which is what -:func:`~phonometry.vibration.junction_transmission.coupling_loss_factor` does +:func:`~phonometry.vibration.structural.junction_transmission.coupling_loss_factor` does with the closed-form coefficients of -:func:`~phonometry.vibration.junction_transmission.junction_transmission`. The +:func:`~phonometry.vibration.structural.junction_transmission.junction_transmission`. The **experimental** route, implemented here, inverts the steady-state power balance from *measured* subsystem energies: it needs no model of the junction at all, and it is the only route open for real joints (welds, bolt rows, @@ -81,7 +81,7 @@ import numpy as np from numpy.typing import ArrayLike, NDArray -from .._internal.validation import ( +from ..._internal.validation import ( require_choice, require_positive, require_positive_array, @@ -380,8 +380,8 @@ def plot( :param language: Label language, ``"en"`` (default) or ``"es"``. :param kwargs: Forwarded to the ``eta_12`` curve. """ - from .._i18n import check_language - from .._plot.vibration import plot_power_injection + from ..._i18n import check_language + from ..._plot.vibration import plot_power_injection check_language(language) return plot_power_injection(self, ax=ax, language=language, **kwargs) diff --git a/src/phonometry/vibration/junction_transmission.py b/src/phonometry/vibration/structural/junction_transmission.py similarity index 98% rename from src/phonometry/vibration/junction_transmission.py rename to src/phonometry/vibration/structural/junction_transmission.py index 43de275b9..b97f5ea1a 100644 --- a/src/phonometry/vibration/junction_transmission.py +++ b/src/phonometry/vibration/structural/junction_transmission.py @@ -142,7 +142,7 @@ **Two shortcuts for right-angle joints (Norton & Karczub 2003, Section 6.6.1).** Alongside the angle-resolved wave approach above, the SEA literature uses a pair of closed forms that need no integration, which is what the -experimental SEA of :mod:`phonometry.vibration.experimental_sea` is normally +experimental SEA of :mod:`phonometry.vibration.structural.experimental_sea` is normally compared against: * :func:`right_angle_transmission_coefficient` (Norton Eqs. 6.53 to 6.55, after @@ -174,7 +174,7 @@ from numpy.typing import ArrayLike, NDArray from scipy.integrate import quad -from .._internal.validation import require_choice, require_positive +from ..._internal.validation import require_choice, require_positive if TYPE_CHECKING: from matplotlib.axes import Axes @@ -442,7 +442,7 @@ def coupling_loss_factor( :param group_velocity: Source-plate bending-wave group velocity ``cg_i``, in m/s (> 0). For a thin plate :math:`c_g = 2 c_B` with the bending phase speed ``cB`` (see - :func:`phonometry.vibration.point_mobility.plate_bending_wave_speed`). + :func:`phonometry.vibration.structural.point_mobility.plate_bending_wave_speed`). :param junction_length: Junction length ``L_ij``, in m (> 0). :param frequency: Frequency ``f``, in hertz (scalar or array, > 0). :param plate_area: Source-plate area ``S_i``, in m^2 (> 0). @@ -687,8 +687,8 @@ def plot(self, ax: Axes | None = None, *, language: str = "en", **kwargs: Any) - Requires matplotlib (``pip install phonometry[plot]``); returns the :class:`~matplotlib.axes.Axes`. """ - from .._i18n import check_language - from .._plot.junction import plot_junction_transmission + from ..._i18n import check_language + from ..._plot.junction import plot_junction_transmission return plot_junction_transmission( self, ax=ax, language=check_language(language), **kwargs @@ -704,8 +704,8 @@ def plot_geometry( :raises ValueError: If the result does not retain its geometry. """ - from .._i18n import check_language - from .._plot.geometry import plot_junction_result_geometry + from ..._i18n import check_language + from ..._plot.geometry import plot_junction_result_geometry check_language(language) return plot_junction_result_geometry(self, ax=ax, language=language, **kwargs) diff --git a/src/phonometry/vibration/mechanical_mobility.py b/src/phonometry/vibration/structural/mechanical_mobility.py similarity index 98% rename from src/phonometry/vibration/mechanical_mobility.py rename to src/phonometry/vibration/structural/mechanical_mobility.py index 64e845d58..27871b8bc 100644 --- a/src/phonometry/vibration/mechanical_mobility.py +++ b/src/phonometry/vibration/structural/mechanical_mobility.py @@ -79,11 +79,11 @@ if TYPE_CHECKING: from matplotlib.axes import Axes - from .._report.metadata import ReportMetadata + from ..._report.metadata import ReportMetadata from numpy.typing import ArrayLike, NDArray -from .._internal.validation import require_non_negative, require_positive +from ..._internal.validation import require_non_negative, require_positive # --------------------------------------------------------------------------- # FRF taxonomy (ISO 7626-1 Table 1). @@ -310,8 +310,8 @@ def plot( Requires matplotlib (``pip install phonometry[plot]``). """ - from .._i18n import check_language - from .._plot.vibration import plot_rigid_mass_calibration + from ..._i18n import check_language + from ..._plot.vibration import plot_rigid_mass_calibration return plot_rigid_mass_calibration( self, ax=ax, language=check_language(language), **kwargs @@ -451,8 +451,8 @@ def plot(self, ax: Axes | None = None, *, language: str = "en", **kwargs: Any) - Requires matplotlib (``pip install phonometry[plot]``); returns the :class:`~matplotlib.axes.Axes`. """ - from .._i18n import check_language - from .._plot.vibration import plot_mobility + from ..._i18n import check_language + from ..._plot.vibration import plot_mobility return plot_mobility(self, ax=ax, language=check_language(language), **kwargs) @@ -497,14 +497,14 @@ def report( fiche always embeds the mobility spectrum, so both are required (``pip install "phonometry[report,plot]"``). """ - from .._i18n import check_language + from ..._i18n import check_language check_language(language) if engine != "reportlab": raise ValueError( f"Unknown report engine {engine!r}; only 'reportlab' is supported." ) - from .._report.iso7626 import render_mobility_report + from ..._report.iso7626 import render_mobility_report return render_mobility_report( self, path, metadata=metadata, verbose=verbose, language=language diff --git a/src/phonometry/vibration/point_mobility.py b/src/phonometry/vibration/structural/point_mobility.py similarity index 99% rename from src/phonometry/vibration/point_mobility.py rename to src/phonometry/vibration/structural/point_mobility.py index f60ab935a..565c7165a 100644 --- a/src/phonometry/vibration/point_mobility.py +++ b/src/phonometry/vibration/structural/point_mobility.py @@ -61,7 +61,7 @@ import numpy as np from numpy.typing import ArrayLike, NDArray -from .._internal.validation import require_positive +from ..._internal.validation import require_positive from .mechanical_mobility import MobilityResult __all__ = [ @@ -94,7 +94,7 @@ def plate_bending_stiffness( :math:`B' = E h^3 / (12 (1 - \nu^2))`, the plate bending stiffness ``B'`` in N.m used throughout this module and by the coincidence frequency of - :func:`phonometry.vibration.radiation_efficiency.coincidence_frequency`. + :func:`phonometry.vibration.structural.radiation_efficiency.coincidence_frequency`. :param youngs_modulus: Young's modulus ``E`` of the plate material, in Pa. :param thickness: Plate thickness ``h``, in m. diff --git a/src/phonometry/vibration/radiation_efficiency.py b/src/phonometry/vibration/structural/radiation_efficiency.py similarity index 96% rename from src/phonometry/vibration/radiation_efficiency.py rename to src/phonometry/vibration/structural/radiation_efficiency.py index d4a04ee7f..e059023e7 100644 --- a/src/phonometry/vibration/radiation_efficiency.py +++ b/src/phonometry/vibration/structural/radiation_efficiency.py @@ -69,7 +69,7 @@ import numpy as np from numpy.typing import ArrayLike, NDArray -from .._internal.validation import require_choice, require_positive +from ..._internal.validation import require_choice, require_positive if TYPE_CHECKING: from matplotlib.axes import Axes @@ -102,7 +102,7 @@ def coincidence_frequency( :param mass_per_area: Mass per unit area ``m''``, in kg/m^2. :param bending_stiffness: Bending stiffness per unit width ``B'``, in N.m - (see :func:`phonometry.vibration.point_mobility.plate_bending_stiffness`). + (see :func:`phonometry.vibration.structural.point_mobility.plate_bending_stiffness`). :param speed_of_sound: Speed of sound in air ``c0`` (Default: 343 m/s). :return: The coincidence frequency ``fc``, in hertz. :raises ValueError: for a non-positive input. @@ -146,8 +146,8 @@ def plot(self, ax: Axes | None = None, *, language: str = "en", **kwargs: Any) - Requires matplotlib (``pip install phonometry[plot]``); returns the :class:`~matplotlib.axes.Axes`. """ - from .._i18n import check_language - from .._plot.vibration import plot_radiation_efficiency + from ..._i18n import check_language + from ..._plot.vibration import plot_radiation_efficiency return plot_radiation_efficiency(self, ax=ax, language=check_language(language), **kwargs) @@ -159,8 +159,8 @@ def plot_geometry( Requires matplotlib (``pip install phonometry[plot]``); returns the :class:`~matplotlib.axes.Axes`. """ - from .._i18n import check_language - from .._plot.geometry import plot_radiation_result_geometry + from ..._i18n import check_language + from ..._plot.geometry import plot_radiation_result_geometry check_language(language) return plot_radiation_result_geometry(self, ax=ax, language=language, **kwargs) diff --git a/src/phonometry/vibration/transfer_stiffness.py b/src/phonometry/vibration/structural/transfer_stiffness.py similarity index 97% rename from src/phonometry/vibration/transfer_stiffness.py rename to src/phonometry/vibration/structural/transfer_stiffness.py index 8791914e2..5f21d1636 100644 --- a/src/phonometry/vibration/transfer_stiffness.py +++ b/src/phonometry/vibration/structural/transfer_stiffness.py @@ -64,12 +64,12 @@ if TYPE_CHECKING: from matplotlib.axes import Axes - from .._report.metadata import ReportMetadata + from ..._report.metadata import ReportMetadata from numpy.typing import ArrayLike, NDArray -from .._internal.validation import require_non_negative, require_positive -from .._internal.warnings import PhonometryWarning +from ..._internal.validation import require_non_negative, require_positive +from ..._internal.warnings import PhonometryWarning from .mechanical_mobility import convert_frf #: Reference dynamic stiffness for the level ``L_k`` (ISO 10846-2/-3, 3.17), N/m. @@ -346,8 +346,8 @@ def plot(self, ax: Axes | None = None, *, language: str = "en", **kwargs: Any) - Requires matplotlib (``pip install phonometry[plot]``); returns the :class:`~matplotlib.axes.Axes`. """ - from .._i18n import check_language - from .._plot.vibration import plot_transfer_stiffness + from ..._i18n import check_language + from ..._plot.vibration import plot_transfer_stiffness return plot_transfer_stiffness(self, ax=ax, language=check_language(language), **kwargs) @@ -397,14 +397,14 @@ def report( fiche always embeds the ``L_k(f)`` spectrum, so both are required (``pip install "phonometry[report,plot]"``). """ - from .._i18n import check_language + from ..._i18n import check_language check_language(language) if engine != "reportlab": raise ValueError( f"Unknown report engine {engine!r}; only 'reportlab' is supported." ) - from .._report.iso10846 import render_transfer_stiffness_report + from ..._report.iso10846 import render_transfer_stiffness_report return render_transfer_stiffness_report( self, path, metadata=metadata, verbose=verbose, language=language diff --git a/tests/test_deprecated_aliases.py b/tests/test_deprecated_aliases.py index 20bee843e..216e9853d 100644 --- a/tests/test_deprecated_aliases.py +++ b/tests/test_deprecated_aliases.py @@ -422,6 +422,15 @@ def test_pre_move_module_path_still_imports(path: str) -> None: "phonometry.metrology.spectra", "phonometry.metrology.synchronous_average", "phonometry.metrology.time_frequency", + "phonometry.vibration.experimental_sea", + "phonometry.vibration.human_vibration", + "phonometry.vibration.junction_transmission", + "phonometry.vibration.machine_diagnostics", + "phonometry.vibration.mechanical_mobility", + "phonometry.vibration.multiple_shock_vibration", + "phonometry.vibration.point_mobility", + "phonometry.vibration.radiation_efficiency", + "phonometry.vibration.transfer_stiffness", ] @@ -438,6 +447,47 @@ def test_pre_split_module_path_still_imports(path: str) -> None: assert public, f"{path} imports but exposes no public names" +def test_a_module_only_split_still_serves_the_dotted_read() -> None: + """``vibration.human_vibration.x`` after the import, not only the import. + + No public name left ``vibration`` in 4.0, only its modules did, so the + package has no names to redirect. The dotted read still has to work: the + import registers the alias in ``sys.modules`` and the attribute has to + come from somewhere. + """ + import importlib + + from phonometry import vibration + + importlib.import_module("phonometry.vibration.human_vibration") + alias = vibration.human_vibration + assert alias is sys.modules["phonometry.vibration.human_vibration"] + with pytest.warns(DeprecationWarning, match="vibration.human.exposure"): + assert alias.daily_exposure is ph.daily_exposure + assert "human_vibration" in dir(vibration) + assert "human_vibration" not in vibration.__all__ + with pytest.raises(AttributeError, match="phonometry.vibration"): + _ = vibration.not_a_name + + +@pytest.mark.parametrize("path", _PRE_SPLIT_MODULE_PATHS) +def test_pre_split_dotted_read_resolves(path: str) -> None: + """Reading the alias off its parent package, which is how code uses it.""" + import importlib + import warnings + + importlib.import_module(path) + parent_name, _, leaf = path.rpartition(".") + parent = importlib.import_module(parent_name) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + resolved = getattr(parent, leaf) + # Either the module alias itself, or the public name that shadowed it + # before the split (``metrology.cepstrum`` was the function, not the + # module, and stays the function). + assert resolved is sys.modules[path] or callable(resolved) + + def test_pre_split_module_shim_names_the_5_0_removal() -> None: """The 4.0 aliases outlive the 3.x ones: they go in 5.0, not in 4.0.""" shim = sys.modules["phonometry.metrology.levels"] diff --git a/tests/test_package_architecture.py b/tests/test_package_architecture.py index 64185abf3..98f5cee22 100644 --- a/tests/test_package_architecture.py +++ b/tests/test_package_architecture.py @@ -140,7 +140,12 @@ def test_subpackage_imports_in_fresh_interpreter(pkg: str) -> None: def test_subpackage_reexports_cover_facade_imports() -> None: """Every name the facade imports from a domain submodule must also be - reachable on the subpackage namespace (the ``env.name`` usage pattern).""" + reachable on the subpackage namespace (the ``env.name`` usage pattern). + + The check is on the top-level package of the import, at whatever depth the + module sits: ``from .vibration.human.exposure import daily_exposure`` has + to leave ``vibration.daily_exposure`` reachable. + """ import importlib facade = ast.parse((SRC / "__init__.py").read_text(encoding="utf-8")) @@ -149,7 +154,10 @@ def test_subpackage_reexports_cover_facade_imports() -> None: if not isinstance(node, ast.ImportFrom) or node.level != 1 or not node.module: continue parts = node.module.split(".") - if len(parts) != 2 or parts[0].startswith("_"): + # A domain module is ``.`` or, since the domains grew a + # second level, ``..``. Checking only the + # two-part form silently stopped covering a domain the day it grew. + if len(parts) < 2 or parts[0].startswith("_"): continue pkg = importlib.import_module(f"phonometry.{parts[0]}") for alias in node.names: diff --git a/tests/vibration/test_human_vibration.py b/tests/vibration/human/test_human_vibration.py similarity index 99% rename from tests/vibration/test_human_vibration.py rename to tests/vibration/human/test_human_vibration.py index 67c071692..e45fef18d 100644 --- a/tests/vibration/test_human_vibration.py +++ b/tests/vibration/human/test_human_vibration.py @@ -1,5 +1,5 @@ # Copyright (c) 2026. Jose Manuel Requena Plens -"""Tests for :mod:`phonometry.vibration.human_vibration`. +"""Tests for :mod:`phonometry.vibration.human.exposure`. The frequency weightings are validated against the ISO 8041-1:2017 Annex B design-goal factors (Tables B.1-B.9) and the Table 1 reference-frequency @@ -21,7 +21,7 @@ ISO8041_1_TABLE5_TOLERANCES, ) -from phonometry.vibration import human_vibration as hv +from phonometry.vibration.human import exposure as hv def _fc(n: int) -> float: diff --git a/tests/vibration/test_human_vibration_report.py b/tests/vibration/human/test_human_vibration_report.py similarity index 100% rename from tests/vibration/test_human_vibration_report.py rename to tests/vibration/human/test_human_vibration_report.py diff --git a/tests/vibration/test_multiple_shock_report.py b/tests/vibration/human/test_multiple_shock_report.py similarity index 99% rename from tests/vibration/test_multiple_shock_report.py rename to tests/vibration/human/test_multiple_shock_report.py index 310a1eb92..41ed56088 100644 --- a/tests/vibration/test_multiple_shock_report.py +++ b/tests/vibration/human/test_multiple_shock_report.py @@ -21,7 +21,7 @@ import pytest from phonometry import ReportMetadata -from phonometry.vibration.multiple_shock_vibration import ( +from phonometry.vibration.human.multiple_shock import ( MZ_FEMALE, MZ_MALE, RISK_THRESHOLDS_FEMALE, diff --git a/tests/vibration/test_multiple_shock_vibration.py b/tests/vibration/human/test_multiple_shock_vibration.py similarity index 93% rename from tests/vibration/test_multiple_shock_vibration.py rename to tests/vibration/human/test_multiple_shock_vibration.py index 39dddc631..5abd570b6 100644 --- a/tests/vibration/test_multiple_shock_vibration.py +++ b/tests/vibration/human/test_multiple_shock_vibration.py @@ -7,6 +7,8 @@ from __future__ import annotations +import math + import numpy as np import pytest from reference_data import ( @@ -21,7 +23,7 @@ ) from scipy.signal import freqz -from phonometry.vibration import multiple_shock_vibration as v +from phonometry.vibration.human import multiple_shock as v # --------------------------------------------------------------------------- # Clause 5.2 - seat-to-spine transfer function. @@ -227,3 +229,12 @@ def test_response_peaks_rejects_2d() -> None: # A 2-D response would create a false crossing at the channel seam. with pytest.raises(ValueError, match="1-D time series"): v.response_peaks(np.zeros((2, 100))) + +def test_the_time_guards_reject_nan() -> None: + """``not t > 0`` is deliberate: ``t <= 0`` would let NaN through.""" + with pytest.raises(ValueError, match="must be positive"): + v.daily_dose(1.0, exposure_time=math.nan, measurement_time=1.0) + with pytest.raises(ValueError, match="must be positive"): + v.daily_dose(1.0, exposure_time=1.0, measurement_time=math.nan) + with pytest.raises(ValueError, match="days_per_year must be positive"): + v.injury_risk(0.5, start_age=20.0, years=20, days_per_year=math.nan) diff --git a/tests/vibration/test_machine_diagnostics.py b/tests/vibration/machinery/test_diagnostics.py similarity index 99% rename from tests/vibration/test_machine_diagnostics.py rename to tests/vibration/machinery/test_diagnostics.py index d221eec54..8f4575ec8 100644 --- a/tests/vibration/test_machine_diagnostics.py +++ b/tests/vibration/machinery/test_diagnostics.py @@ -35,7 +35,7 @@ import numpy as np import pytest -from phonometry.vibration.machine_diagnostics import ( +from phonometry.vibration.machinery.diagnostics import ( FaultFrequencyResult, bearing_fault_frequencies, blade_pass_frequencies, diff --git a/tests/vibration/test_experimental_sea.py b/tests/vibration/structural/test_experimental_sea.py similarity index 99% rename from tests/vibration/test_experimental_sea.py rename to tests/vibration/structural/test_experimental_sea.py index 74766d6ce..f9a2abbd9 100644 --- a/tests/vibration/test_experimental_sea.py +++ b/tests/vibration/structural/test_experimental_sea.py @@ -53,7 +53,7 @@ import pytest from phonometry.building.flanking_transmission import modal_density as en12354_n -from phonometry.vibration.experimental_sea import ( +from phonometry.vibration.structural.experimental_sea import ( bar_modal_density, beam_modal_density, cylindrical_shell_modal_density, diff --git a/tests/vibration/test_junction_transmission.py b/tests/vibration/structural/test_junction_transmission.py similarity index 99% rename from tests/vibration/test_junction_transmission.py rename to tests/vibration/structural/test_junction_transmission.py index 21a4297f6..98f93ad7d 100644 --- a/tests/vibration/test_junction_transmission.py +++ b/tests/vibration/structural/test_junction_transmission.py @@ -57,8 +57,8 @@ wave_vibration_reduction_index, ) from phonometry.vibration import JunctionTransmissionResult -from phonometry.vibration.experimental_sea import flat_plate_modal_density -from phonometry.vibration.point_mobility import plate_bending_wave_speed +from phonometry.vibration.structural.experimental_sea import flat_plate_modal_density +from phonometry.vibration.structural.point_mobility import plate_bending_wave_speed # Junction constants (Hopkins Eq. 5.12/5.13) reproduced here so the oracle never # reads them from the module under test. diff --git a/tests/vibration/test_mechanical_mobility.py b/tests/vibration/structural/test_mechanical_mobility.py similarity index 100% rename from tests/vibration/test_mechanical_mobility.py rename to tests/vibration/structural/test_mechanical_mobility.py diff --git a/tests/vibration/test_mobility_report.py b/tests/vibration/structural/test_mobility_report.py similarity index 98% rename from tests/vibration/test_mobility_report.py rename to tests/vibration/structural/test_mobility_report.py index 9ae0a4690..ff346f9e2 100644 --- a/tests/vibration/test_mobility_report.py +++ b/tests/vibration/structural/test_mobility_report.py @@ -21,7 +21,7 @@ from phonometry import ReportMetadata from phonometry.vibration import sdof_mobility_result -from phonometry.vibration.mechanical_mobility import MobilityResult +from phonometry.vibration.structural.mechanical_mobility import MobilityResult _PDF_MAGIC = b"%PDF" diff --git a/tests/vibration/test_point_mobility.py b/tests/vibration/structural/test_point_mobility.py similarity index 99% rename from tests/vibration/test_point_mobility.py rename to tests/vibration/structural/test_point_mobility.py index b12a09239..c3bda7bba 100644 --- a/tests/vibration/test_point_mobility.py +++ b/tests/vibration/structural/test_point_mobility.py @@ -27,7 +27,7 @@ longitudinal_rod_impedance, plate_bending_stiffness, ) -from phonometry.vibration.point_mobility import ( +from phonometry.vibration.structural.point_mobility import ( beam_bending_wave_speed, infinite_beam_impedance, longitudinal_rod_mobility, diff --git a/tests/vibration/test_radiation_efficiency.py b/tests/vibration/structural/test_radiation_efficiency.py similarity index 100% rename from tests/vibration/test_radiation_efficiency.py rename to tests/vibration/structural/test_radiation_efficiency.py diff --git a/tests/vibration/test_transfer_stiffness.py b/tests/vibration/structural/test_transfer_stiffness.py similarity index 99% rename from tests/vibration/test_transfer_stiffness.py rename to tests/vibration/structural/test_transfer_stiffness.py index 8f8592e9c..683b6661c 100644 --- a/tests/vibration/test_transfer_stiffness.py +++ b/tests/vibration/structural/test_transfer_stiffness.py @@ -30,7 +30,7 @@ transfer_stiffness_indirect, transfer_stiffness_level, ) -from phonometry.vibration.transfer_stiffness import TRANSMISSIBILITY_LIMIT +from phonometry.vibration.structural.transfer_stiffness import TRANSMISSIBILITY_LIMIT # --------------------------------------------------------------------------- diff --git a/tests/vibration/test_transfer_stiffness_report.py b/tests/vibration/structural/test_transfer_stiffness_report.py similarity index 100% rename from tests/vibration/test_transfer_stiffness_report.py rename to tests/vibration/structural/test_transfer_stiffness_report.py diff --git a/tests/vibration/test_vibration_plot_i18n.py b/tests/vibration/test_vibration_plot_i18n.py index 0894948c4..1908813bf 100644 --- a/tests/vibration/test_vibration_plot_i18n.py +++ b/tests/vibration/test_vibration_plot_i18n.py @@ -54,7 +54,7 @@ def test_multiple_shock_spanish_title_translates_sex() -> None: import matplotlib matplotlib.use("Agg") - from phonometry.vibration.multiple_shock_vibration import ( + from phonometry.vibration.human.multiple_shock import ( MZ_MALE, RISK_THRESHOLDS_MALE, MultipleShockResult,