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.
discover_operating_pointsGroups a directory’s
<case>.<n>.linfiles into namedDiscoveredOperatingPointobjects (one per<case>root, ordered by case); each behaves as a sequence of itsLinFileobjects. RaisesFileNotFoundErrorwhen the directory contains no.linfiles. Accepts astrorPath.run_studyValidates
parameter_namefirst, then runs the pipeline and returns aStudyResultcarrying thePipelineResultand aProvenancerecord. Operating points are sorted deterministically by the operating parameter, and the recorded provenance is in that same sorted order (so it lines up with the Campbell result).Provenance/StudyResult.write_bundleThe provenance records the library version, a timestamp (the UTC time of the run by default; a caller-injected
timestampis recorded as provided), the tuning thresholds and pipeline-normalized harmonics, anenvironmentblock (Python, platform, and scientific-dependency versions), and, per operating point, the case name, full azimuth list, averaged rotor/wind speed, operating-parameter value, and that point’s own SHA-256-hashed source files.write_bundlewritesprovenance.json(the manifest) andcampbell.csvto a directory it creates, accepting astrorPath.
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 0.y.z alpha series the public API may change between minor versions;
such changes are recorded in the Changelog. Once the API
stabilises at 1.0.0, breaking changes follow semantic versioning.