Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ figures:
- scripts/check_figures.py
- scripts/generated_assets.py
- src/phonometry/_plot/**
- src/phonometry/_plotting.py
- requirements-figures.txt

reports:
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
from the top level; from `phonometry.filters` it still resolves until 5.0,
with the usual notice.

- The eighteen domain packages are named explicitly in `phonometry/__init__.py`
rather than bound as a side effect of importing the flat API. Nothing changes
at runtime, where `phonometry.building` already resolved; what changes is
that a type checker can follow it, which the removal of the package-level
`__getattr__` shim would otherwise have taken away.

- `phonometry.underwater` has three families, along the three questions an
underwater problem asks. `underwater.sources` is what makes the sound:
ISO 17208 ship radiated noise, shipping traffic, impact pile driving and the
Expand Down Expand Up @@ -1866,6 +1872,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

### Removed

- The 3.1 renames, at the release their notices named. The function aliases
`octavefilter`, `getansifrequencies`, `normalizedfreq` and
`calculate_sensitivity` are gone; use `octave_filter`, `nominal_frequencies`,
`normalized_frequencies` and `sensitivity`. The ISO 12999-1 pair that
shadowed the GUM functions at the package root, the bare `coverage_factor`
and `expanded_uncertainty`, are gone; use `insulation_coverage_factor` and
`insulation_expanded_uncertainty`, and read the GUM pair from
`phonometry.metrology.uncertainty`. The renamed constants
`OCTAVE_BANDS_HZ`, `THIRD_OCTAVE_BANDS_HZ`, `BASE_PLATE_BANDS_HZ`,
`BAND_CENTRES` and `ExposureWarning` are gone; use `OCTAVE_BANDS`,
`THIRD_OCTAVE_BANDS`, `BASE_PLATE_BANDS`, `BAND_CENTERS` and
`OccupationalExposureWarning`. The deprecated keywords are gone too:
`sample_rate` is `fs` in the ISO 13472 functions, `humidity` is
`relative_humidity` in the ISO 9613 ones, and `room_volume` is `volume` in
the ISO 3744 pair.

`phonometry._plotting`, the 3.2 re-export of the renderers that moved to
`phonometry._plot`, is gone with them.

- The flat pre-3.2 module paths, as 3.2 announced when it deprecated them:
`phonometry.levels`, `phonometry.insulation`, `phonometry.room_ir` and the
eighty-odd siblings that the modularization grouped into domain subpackages
Expand Down
22 changes: 12 additions & 10 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,6 @@ well. The pre-3.2 flat paths, written without a subpackage, were removed in
| `FilterBankWarning` | `warning class` | **Fractional-octave filter-bank advisory.**<br>Emitted for filter-bank processing pitfalls | `warnings.simplefilter('error', FilterBankWarning)` |
| `TonalityWarning` | `warning class` | **Tonality advisory.**<br>Emitted for biased tonality estimates (e.g. coarse FFT resolution) | `warnings.simplefilter('error', TonalityWarning)` |
| `STIWarning` | `warning class` | **STI/STIPA advisory.**<br>Emitted for suspect speech-intelligibility measurements or inputs | `warnings.simplefilter('error', STIWarning)` |
| `octavefilter` / `getansifrequencies` / `normalizedfreq` / `calculate_sensitivity` / `coverage_factor` / `expanded_uncertainty` | `function` | **Deprecated aliases (warn on use; removal in 4.0).**<br>New names: `octave_filter`, `nominal_frequencies`, `normalized_frequencies`, `sensitivity`, `insulation_coverage_factor`, `insulation_expanded_uncertainty` | `octave_filter(x, fs) # not octavefilter` |
| `__version__` | `str` | **Package version string.**<br>(no parameters) | `phonometry.__version__ # '3.2.0'` |
| `.plot()` | `method` | **One-line canonical figure on every result object (soft matplotlib dependency).**<br>Available on `ZwickerLoudness`, `MooreGlasbergLoudness`, `MooreGlasbergTimeVaryingLoudness`, `EcmaLoudness`, `EcmaTonality`, `EcmaRoughness`, `PsychoacousticAnnoyanceResult`, `FluctuationStrengthResult`, `ProgramLoudnessResult`, `KWeightingResponse`, `STIResult`, `SIIResult`, `SIIProcedure`, `StandardSpeechSpectrum`, `NCResult`, `RCResult`, `AgeThresholdResult`, `NiptsResult`, `HtlanResult`, `ImpulseProminenceResult`, `ImpulsiveSoundResult`, `MultipleShockResult`, `ImpulseResponseResult`, `DecayCurve`, `RoomAcousticsResult`, `ReverberationResult`, `ReverberationModelResult`, `DynamicStiffnessResult`, `MobilityResult`, `TransferStiffnessResult`, `VibrationSoundPowerResult`, `StructureBornePowerResult`, `InstalledSourceResult`, `WeightedRatingResult`, `ImpactRatingResult`, `FacadeInsulationResult`, `LabAirborneInsulationResult`, `LabImpactInsulationResult`, `SoundPowerResult`, `ReverberationSoundPowerResult`, `SoundPowerIntensityResult`, `PrecisionSoundPowerResult`, `PrecisionIntensityResult`, `IntensityResult`, `UncertaintyResult`, `AbsorptionRatingResult`, `ScatteringResult`, `DiffusionResult`, `DiffusionSpectrum`, `InsituAbsorptionResult`, `WeightingResponse`, `WeightedSpectrum` and `DailyVibrationExposure`.<br>• `ax`: existing Axes, or None to build a fresh figure (Default: None)<br>• returns the Matplotlib `Axes` (an array of Axes for multi-panel figures); never calls `plt.show()`<br>• needs matplotlib (`pip install phonometry[plot]`) | `res.plot()`<br>`decay_curve(ir, fs).plot()` |

Expand All @@ -1252,12 +1251,15 @@ well. The pre-3.2 flat paths, written without a subpackage, were removed in
- `octave_filter()` caches filter bank designs internally (32 entries), so
repeated calls with the same parameters skip the design phase. For explicit
control use `OctaveFilterBank`.
- Deprecated aliases (kept for one cycle, warn on use, removal in 4.0):
`octavefilter` → `octave_filter`, `getansifrequencies` →
`nominal_frequencies`, `normalizedfreq` → `normalized_frequencies`,
`calculate_sensitivity` → `sensitivity`, `coverage_factor` →
`insulation_coverage_factor`, `expanded_uncertainty` →
`insulation_expanded_uncertainty`, plus the renamed names
`OCTAVE_BANDS_HZ` → `OCTAVE_BANDS`, `THIRD_OCTAVE_BANDS_HZ` →
`THIRD_OCTAVE_BANDS`, `BASE_PLATE_BANDS_HZ` → `BASE_PLATE_BANDS` and
`ExposureWarning` → `OccupationalExposureWarning`.
- The 3.1 aliases are gone, as their notices said they would be in 4.0:
`octavefilter`, `getansifrequencies`, `normalizedfreq`,
`calculate_sensitivity`, the bare `coverage_factor` and
`expanded_uncertainty` of ISO 12999-1, the `OCTAVE_BANDS_HZ`,
`THIRD_OCTAVE_BANDS_HZ` and `BASE_PLATE_BANDS_HZ` constants,
`BAND_CENTRES`, `ExposureWarning`, and the `sample_rate`, `humidity` and
`room_volume` keywords. Use `octave_filter`, `nominal_frequencies`,
`normalized_frequencies`, `sensitivity`, `insulation_coverage_factor`,
`insulation_expanded_uncertainty`, `OCTAVE_BANDS`, `THIRD_OCTAVE_BANDS`,
`BASE_PLATE_BANDS`, `phonometry.speech.sii.BAND_CENTERS`,
`OccupationalExposureWarning`, `fs`,
`relative_humidity` and `volume`.
22 changes: 12 additions & 10 deletions llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3447,7 +3447,6 @@ well. The pre-3.2 flat paths, written without a subpackage, were removed in
| `FilterBankWarning` | `warning class` | **Fractional-octave filter-bank advisory.**<br>Emitted for filter-bank processing pitfalls | `warnings.simplefilter('error', FilterBankWarning)` |
| `TonalityWarning` | `warning class` | **Tonality advisory.**<br>Emitted for biased tonality estimates (e.g. coarse FFT resolution) | `warnings.simplefilter('error', TonalityWarning)` |
| `STIWarning` | `warning class` | **STI/STIPA advisory.**<br>Emitted for suspect speech-intelligibility measurements or inputs | `warnings.simplefilter('error', STIWarning)` |
| `octavefilter` / `getansifrequencies` / `normalizedfreq` / `calculate_sensitivity` / `coverage_factor` / `expanded_uncertainty` | `function` | **Deprecated aliases (warn on use; removal in 4.0).**<br>New names: `octave_filter`, `nominal_frequencies`, `normalized_frequencies`, `sensitivity`, `insulation_coverage_factor`, `insulation_expanded_uncertainty` | `octave_filter(x, fs) # not octavefilter` |
| `__version__` | `str` | **Package version string.**<br>(no parameters) | `phonometry.__version__ # '3.2.0'` |
| `.plot()` | `method` | **One-line canonical figure on every result object (soft matplotlib dependency).**<br>Available on `ZwickerLoudness`, `MooreGlasbergLoudness`, `MooreGlasbergTimeVaryingLoudness`, `EcmaLoudness`, `EcmaTonality`, `EcmaRoughness`, `PsychoacousticAnnoyanceResult`, `FluctuationStrengthResult`, `ProgramLoudnessResult`, `KWeightingResponse`, `STIResult`, `SIIResult`, `SIIProcedure`, `StandardSpeechSpectrum`, `NCResult`, `RCResult`, `AgeThresholdResult`, `NiptsResult`, `HtlanResult`, `ImpulseProminenceResult`, `ImpulsiveSoundResult`, `MultipleShockResult`, `ImpulseResponseResult`, `DecayCurve`, `RoomAcousticsResult`, `ReverberationResult`, `ReverberationModelResult`, `DynamicStiffnessResult`, `MobilityResult`, `TransferStiffnessResult`, `VibrationSoundPowerResult`, `StructureBornePowerResult`, `InstalledSourceResult`, `WeightedRatingResult`, `ImpactRatingResult`, `FacadeInsulationResult`, `LabAirborneInsulationResult`, `LabImpactInsulationResult`, `SoundPowerResult`, `ReverberationSoundPowerResult`, `SoundPowerIntensityResult`, `PrecisionSoundPowerResult`, `PrecisionIntensityResult`, `IntensityResult`, `UncertaintyResult`, `AbsorptionRatingResult`, `ScatteringResult`, `DiffusionResult`, `DiffusionSpectrum`, `InsituAbsorptionResult`, `WeightingResponse`, `WeightedSpectrum` and `DailyVibrationExposure`.<br>• `ax`: existing Axes, or None to build a fresh figure (Default: None)<br>• returns the Matplotlib `Axes` (an array of Axes for multi-panel figures); never calls `plt.show()`<br>• needs matplotlib (`pip install phonometry[plot]`) | `res.plot()`<br>`decay_curve(ir, fs).plot()` |

Expand All @@ -3465,15 +3464,18 @@ well. The pre-3.2 flat paths, written without a subpackage, were removed in
- `octave_filter()` caches filter bank designs internally (32 entries), so
repeated calls with the same parameters skip the design phase. For explicit
control use `OctaveFilterBank`.
- Deprecated aliases (kept for one cycle, warn on use, removal in 4.0):
`octavefilter` → `octave_filter`, `getansifrequencies` →
`nominal_frequencies`, `normalizedfreq` → `normalized_frequencies`,
`calculate_sensitivity` → `sensitivity`, `coverage_factor` →
`insulation_coverage_factor`, `expanded_uncertainty` →
`insulation_expanded_uncertainty`, plus the renamed names
`OCTAVE_BANDS_HZ` → `OCTAVE_BANDS`, `THIRD_OCTAVE_BANDS_HZ` →
`THIRD_OCTAVE_BANDS`, `BASE_PLATE_BANDS_HZ` → `BASE_PLATE_BANDS` and
`ExposureWarning` → `OccupationalExposureWarning`.
- The 3.1 aliases are gone, as their notices said they would be in 4.0:
`octavefilter`, `getansifrequencies`, `normalizedfreq`,
`calculate_sensitivity`, the bare `coverage_factor` and
`expanded_uncertainty` of ISO 12999-1, the `OCTAVE_BANDS_HZ`,
`THIRD_OCTAVE_BANDS_HZ` and `BASE_PLATE_BANDS_HZ` constants,
`BAND_CENTRES`, `ExposureWarning`, and the `sample_rate`, `humidity` and
`room_volume` keywords. Use `octave_filter`, `nominal_frequencies`,
`normalized_frequencies`, `sensitivity`, `insulation_coverage_factor`,
`insulation_expanded_uncertainty`, `OCTAVE_BANDS`, `THIRD_OCTAVE_BANDS`,
`BASE_PLATE_BANDS`, `phonometry.speech.sii.BAND_CENTERS`,
`OccupationalExposureWarning`, `fs`,
`relative_humidity` and `volume`.

---

Expand Down
20 changes: 0 additions & 20 deletions site/src/content/docs/reference/api/building/uncertainty.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,6 @@ coefficients, also the model/reality combination of Formula (A.2).
| :--- | :--- |
| ValueError | No components, or a negative component. |

## coverage_factor

```python
coverage_factor(confidence: float = 0.95, one_sided: bool = False) -> float
```

Deprecated alias of [`insulation_coverage_factor`](/phonometry/reference/api/building/uncertainty/#insulation_coverage_factor).

## COVERAGE_FACTORS

*Constant* (`mappingproxy`).
Expand All @@ -169,18 +161,6 @@ Deprecated alias of [`insulation_coverage_factor`](/phonometry/reference/api/bui
COVERAGE_FACTORS = {(0.68, False): 1.0, (0.8, False): 1.28, (0.9, False): 1.65, (0.95, False): 1.96, (0.99, False): 2.58, (0.999, False): 3.29, (0.84, True): 1.0, (0.9, True): 1.28, (0.95, True): 1.65, (0.975, True): 1.96, (0.995, True): 2.58, (0.9995, True): 3.29}
```

## expanded_uncertainty

```python
expanded_uncertainty(
u: float,
coverage: float = 0.95,
one_sided: bool = False,
) -> float
```

Deprecated alias of [`insulation_expanded_uncertainty`](/phonometry/reference/api/building/uncertainty/#insulation_expanded_uncertainty).

## insulation_coverage_factor

```python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ atmospheric_absorption(
temperature: float = 20.0,
relative_humidity: float | None = None,
pressure: float = 101.325,
*,
humidity: float | str = 'deprecated',
) -> NDArray[np.float64]
```

Expand Down Expand Up @@ -87,7 +85,6 @@ the nearest exact midband.
| `temperature` | Air temperature, in degrees Celsius. |
| `relative_humidity` | Relative humidity, in percent (default 70). |
| `pressure` | Atmospheric pressure, in kilopascals. |
| `humidity` | Deprecated alias of `relative_humidity` (remove in 4.0). |

**Returns:** `Aatm` per band, in decibels.

Expand Down Expand Up @@ -385,8 +382,6 @@ outdoor_propagation_attenuation(
relative_humidity: float | None = None,
pressure: float = 101.325,
projected_distance: float | None = None,
*,
humidity: float | str = 'deprecated',
) -> OutdoorAttenuation
```

Expand Down Expand Up @@ -417,7 +412,6 @@ barrier $A_{bar} = D_z$
| `relative_humidity` | Relative humidity, in percent (default 70). |
| `pressure` | Atmospheric pressure, in kilopascals. |
| `projected_distance` | Ground-plane projected distance `dp`, in metres; defaults to $\sqrt{d^2 - (h_s - h_r)^2}$. |
| `humidity` | Deprecated alias of `relative_humidity` (remove in 4.0). |

**Returns:** [`OutdoorAttenuation`](/phonometry/reference/api/environment/outdoor-propagation/#outdoorattenuation) with the per-band term breakdown.

Expand Down Expand Up @@ -549,8 +543,6 @@ predicted_receiver_level(
d_omega: float = 0.0,
c0: float | None = None,
projected_distance: float | None = None,
*,
humidity: float | str = 'deprecated',
) -> NDArray[np.float64]
```

Expand Down Expand Up @@ -588,7 +580,6 @@ convenience.
| `d_omega` | Solid-angle index `DOmega`, in decibels (see [`directivity_omega`](/phonometry/reference/api/environment/outdoor-propagation/#directivity_omega) for the alternative ground method). |
| `c0` | Meteorological factor `C0`, in decibels; `None` returns the downwind level `LfT(DW)` ($C_{met} = 0$). |
| `projected_distance` | Ground-plane projected distance `dp`, in metres. |
| `humidity` | Deprecated alias of `relative_humidity` (remove in 4.0). |

**Returns:** Predicted octave-band level per frequency, in decibels.

Expand Down
8 changes: 0 additions & 8 deletions site/src/content/docs/reference/api/filters/core.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,6 @@ Multichannel support: If x is 2D (channels, samples), each channel is filtered.

**Returns:** A tuple containing (SPL_array, Frequencies_list) or (SPL_array, Frequencies_list, signals). When *nominal=True*, the frequency list contains `List[str]` labels instead of floats. (*Union[Tuple[np.ndarray, List[float]], Tuple[np.ndarray, List[str]], Tuple[np.ndarray, List[float], List[np.ndarray]], Tuple[np.ndarray, List[str], List[np.ndarray]]]*)

## octavefilter

```python
octavefilter(*args: Any, **kwargs: Any) -> Any
```

Deprecated alias of [`octave_filter`](/phonometry/reference/api/filters/core/#octave_filter).

## OctaveFilterBank

```python
Expand Down
19 changes: 0 additions & 19 deletions site/src/content/docs/reference/api/filters/frequencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@ Frequency calculation logic according to ANSI/IEC standards.

> Auto-generated from the source docstrings by `scripts/generate_api_docs.py` (`make api-docs`). Do not edit by hand.

## getansifrequencies

```python
getansifrequencies(
fraction: float,
limits: list[float] | None = None,
) -> tuple[list[float], list[float], list[float], list[str]]
```

Deprecated alias of [`nominal_frequencies`](/phonometry/reference/api/filters/frequencies/#nominal_frequencies).

## nominal_frequencies

```python
Expand Down Expand Up @@ -55,11 +44,3 @@ Get standardized IEC center frequencies.
| `fraction` | 1 or 3 (Octave or 1/3 Octave). |

**Returns:** List of standard frequencies.

## normalizedfreq

```python
normalizedfreq(fraction: int) -> list[float]
```

Deprecated alias of [`normalized_frequencies`](/phonometry/reference/api/filters/frequencies/#normalized_frequencies).
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ adrienne_window(
trailing_duration: float = 0.005,
leading_edge: str = 'blackman-harris',
trailing_edge: str = 'blackman-harris',
sample_rate: float | str = 'deprecated',
) -> Real
```

Expand Down Expand Up @@ -144,7 +143,6 @@ normative fixed set of timings. The lower usable frequency scales as
| `trailing_duration` | Trailing-edge (fall) duration, in seconds. |
| `leading_edge` | Leading-edge shape, `"blackman-harris"` or `"cosine-squared"`. |
| `trailing_edge` | Trailing-edge shape, `"blackman-harris"` or `"cosine-squared"`. |
| `sample_rate` | Deprecated alias of `fs` (remove in 4.0). |

**Returns:** The time-domain window, one sample per `1 / fs` (length `round((leading + flat + trailing) * fs)` samples).

Expand Down Expand Up @@ -333,7 +331,6 @@ insitu_absorption_spectrum(
f_min: float = 250.0,
f_max: float = 4000.0,
clip_negative: bool = True,
sample_rate: float | str = 'deprecated',
) -> InsituAbsorptionResult
```

Expand All @@ -359,7 +356,6 @@ in a plottable [`InsituAbsorptionResult`](/phonometry/reference/api/materials/ro
| `f_min` | Lowest band centre to report, in hertz (default 250 Hz). |
| `f_max` | Highest band centre to report, in hertz (default 4000 Hz). |
| `clip_negative` | Clip negative band results to zero (default `True`). |
| `sample_rate` | Deprecated alias of `fs` (remove in 4.0). |

**Returns:** An [`InsituAbsorptionResult`](/phonometry/reference/api/materials/road-absorption/#insituabsorptionresult) with `.plot()`.

Expand All @@ -382,7 +378,6 @@ insitu_reflection_factor(
fs: float | None = None,
delay: float | None = None,
n: int | None = None,
sample_rate: float | str = 'deprecated',
) -> Complex
```

Expand Down Expand Up @@ -411,7 +406,6 @@ Annex C; the frequency-dependent form of Annex G).
| `fs` | Sampling frequency, in hertz; required with `delay` for phase restoration. |
| `delay` | Reflected-path delay `dtau` to undo, in seconds; `None` returns the raw spectral ratio. |
| `n` | FFT length; defaults to the longer of the two impulse responses. |
| `sample_rate` | Deprecated alias of `fs` (remove in 4.0). |

**Returns:** Complex reflection factor `r(f)` at the `rfft` frequency bins.

Expand Down
17 changes: 0 additions & 17 deletions site/src/content/docs/reference/api/metrology/calibration.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,6 @@ Calibration utilities for mapping digital signals to physical SPL levels.

> Auto-generated from the source docstrings by `scripts/generate_api_docs.py` (`make api-docs`). Do not edit by hand.

## calculate_sensitivity

```python
calculate_sensitivity(
ref_signal: list[float] | np.ndarray,
target_spl: float = 94.0,
ref_pressure: float = 2e-05,
fs: int | None = None,
validate: bool = True,
max_fluctuation_db: float | None = None,
frequency: float = 1000.0,
narrowband: bool = False,
) -> float
```

Deprecated alias of [`sensitivity`](/phonometry/reference/api/metrology/calibration/#sensitivity).

## CalibrationWarning

The calibration reference recording looks unreliable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ the two sources, so the room absorption need not be known.
```python
sound_power_reverberation(
levels: np.ndarray,
t60: np.ndarray,
t60: float | np.ndarray,
volume: float,
surface_area: float,
frequencies: np.ndarray,
Expand Down
Loading