calamari.transitions.detect_transitions_all#

calamari.transitions.detect_transitions_all(measurements, *, link=None, robust=None, smooth_window=None, **kwargs)#

Detect over many sweeps, collecting failures instead of hiding them.

Accepts Measurements and/or the (T_K, Measurement) pairs that calamari.sweeps.split_isotherms() returns (the pair’s measurement is used; its own columns carry the coordinates). A sweep that is refused (mixed scan kind, drifting fixed parameter, multi-frequency without frequency=, …) or fails lands in skipped as (path, reason) – an empty table with a populated skipped is “everything failed”, not “no transitions”.

Every row carries sweep_id, the sweep’s position in measurements, counted over every entry including the skipped ones: an id therefore names the same sweep however many others fail, and the gaps are listed in params['skipped_sweep_ids'] (parallel to skipped). measurement_file cannot do this job, because the isotherms split_isotherms() cuts from one file all carry that file’s path. Each params['per_sweep'] entry records its sweep_id too, and curves is keyed by (sweep_id, signal) for the same reason; read a sweep’s curves with TransitionResult.curve().

Adds a probe column ('AC'/'DC', from each row’s signal). link= and robust= (mappings of TransitionResult.link() and TransitionResult.robust() keyword arguments) apply those steps in the same call for pipeline ergonomics; the settings are recorded identically either way. The order is link then robust, which is the only useful one: gating on a chain statistic requires the chains to exist, and this is the entry point where a whole family of sweeps is in hand – the only place cross-sweep recurrence is visible at all. **kwargs forward to detect_transitions().

Parameters:
  • smooth_window (float | Callable[[Measurement], float | None] | None) – A single physical-units window applied to every sweep – the historical behaviour – may need adjustment for sweeps with different sampling densities, noise or physical feature widths. Pass a callable f(measurement) -> float | None instead and it is invoked per sweep (the pair’s Measurement for a split_isotherms entry), so a caller can key the window off e.g. the sweep’s own point count or spacing. An exception from the callable, or a return value that is not a positive finite number or None, is treated as that sweep’s failure and recorded in skipped (never raised out of the batch, and never silently substituted). What was actually passed to detect_transitions() for every searched sweep is recorded in params['per_sweep'], in results order, so the resolved windows remain available without retaining the callable. Each entry’s per_signal records include any resolved moment source; original inputs and external preprocessing must still be retained.

  • **kwargs – Forwarded to detect_transitions(). Shared configuration is checked before consuming any sweeps, including an empty batch. Invalid methods, noise, smoothing or selection settings raise rather than skipping every sweep. Data-dependent refusals remain in skipped; each sweep is then screened on its own (so 'warn' warns once per sweep with a flagged point in its search), and each sweep’s params['outliers'] is copied into its per_sweep entry – where screened shows which sweeps went through unscreened because quality() could not score them. Under 'drop' such a sweep is refused into skipped instead. A QualityReport describes one file, so in a batch it is refused – into skipped – by every sweep it does not describe; pass a mode instead.

Return type:

TransitionResult