API contract¶
This page states the guarantees VANE’s public entry points make, independent of their implementation. They hold for the documented public API; private helpers may change without notice.
General guarantees¶
- Determinism.
Given the same inputs, every analysis function returns identical results. There are no random restarts, hidden global state, or wall-clock dependence. Stochastic utilities (the benchmark noise sweep, synthetic training data) are explicitly seeded.
- Validation at the boundary.
Inputs are validated where they enter the library and rejected with a specific, typed exception and a clear message, rather than surfacing as an opaque lower-level error. Numerical results are never silently produced from malformed input.
- Typed and documented.
Every public function has complete type annotations and a NumPy-style docstring stating its parameters, returns, and the conditions under which it raises.
Entry-point guarantees¶
read_lin_fileReturns a
LinFileonly for a well-formed modern.linfile. RaisesLinFileFormatErrorfor an empty, truncated, legacy, or structurally invalid file; for a non-finite operating-point scalar; or for anA/B/C/Dmatrix whose shape disagrees with the channel-table dimensions. Overflow markers in matrix data becomenan.mbc3_transformRequires one coherent operating point: a non-empty set of azimuth files with consistent channel layout, distinct azimuths (including the wrap-around), and a rotor speed that does not drift. Violations raise
ValueError. The result is the azimuth-averaged non-rotating model; withretain_per_azimuth=Trueit also keeps the per-azimuth matrices.compute_modes/modes_from_mbcRaise
ValueErrorfor a non-finite state matrix. Return conjugate-collapsed modes (positive-imaginary representatives) with frequencies, damping, phase- normalised shapes, condition numbers, degeneracy flags, and unstable/over-damped counts.identify_modesRejects a
frequency_weight,mac_threshold, orambiguity_marginoutside[0, 1](NaN included) and inconsistent mode-shape layouts. Returns deterministic tracks, each with a confidence and an ambiguity flag.excitation_frequencies/find_resonancesReject non-positive, fractional, non-finite, or duplicate harmonics; an empty harmonic set is a valid no-op.
find_resonancesrequires a rotor-speed (rpm) Campbell diagram.ModalPipelineValidates its tuning weights and harmonics at construction, and rejects an empty operating-point set, an unknown parameter name, or non-finite/duplicate operating-parameter values at
run. Operating points are sorted by the operating parameter, so input order does not affect the result.state_space/modal_state_spaceExport a dimension-checked LTI system. A modal realisation re-extracts to the same frequencies and damping it encodes (export fidelity).
modes_table/campbell_table/write_tableReject length mismatches between a solution and its optional label/confidence/ spread inputs, a Campbell parameter name colliding with a reserved column, and an unsupported file suffix.
Exceptions¶
LinFileFormatError(aValueErrorsubclass) — malformed linearization input.ValueError— invalid arguments or incoherent inputs to an analysis function.IndexError— out-of-range operating-point or mode indices.
Stability¶
During the alpha series (pre-0.1.0) the public API may change between minor
versions; such changes are recorded in the Changelog. From the
first tagged release, breaking changes follow semantic versioning.