Skip to content

Latest commit

 

History

History
273 lines (265 loc) · 17.3 KB

run-schema.md

File metadata and controls

273 lines (265 loc) · 17.3 KB

Generated run plan schema

本页由 src/wavebench/services/run_plan.py:format_run_plan_schema() 生成。 手写的使用说明见run plan Reference。

WaveBench run plan schema

Top-level tables:
  [experiment] optional: name, label
  [safety] optional: scope_guard_channel, require_scope_coupling_not, allow_50ohm, safety_gate, off_source_channels, off_power_channels
  [restore] optional: source_state, source_channel, source_channels
  [[steps]] required: kind
  [[steps]] optional structural field: id matching ^[a-z][a-z0-9_-]{0,63}$

Supported step kinds:
  - analysis.pair
      required: source, reference_channel, response_channel, operations
      optional : expect, on_failure, resources
      note     : Analyze two evidence-validated channels from one earlier capture package after hardware cleanup. Accepts synthetic or driver-owned frozen-single synchronization evidence.
  - analysis.pipeline
      required: source, operations
      optional : expect, on_failure, resources
      note     : Process one earlier scope.capture NPY after all hardware sessions close. Uses a validated linear operator list, checks optional dependencies on demand, and never opens an instrument.
  - dmm.read
      required: -
      optional : expect, function, on_failure, safety_gate
      note     : Read one DMM measurement over the configured backend; default function is dcv unless overridden.
  - power.output
      required: state
      optional : channel, on_failure, safety_gate
      note     : Turn power-supply channel output on or off; does not change voltage/current limit.
  - power.set
      required: voltage_v, current_limit_a
      optional : channel, on_failure, safety_gate
      note     : Set DP800 voltage/current limit; does not change output state.
  - power.status
      required: -
      optional : channel, on_failure, safety_gate
      note     : Read power-supply channel state without changing output.
  - rf_source.modulated_output_enable
      required: port_id, modulation_kind, internal_frequency_hz
      optional : depth_percent, frequency_deviation_hz, on_failure, phase_deviation_rad, safety_gate
      note     : Enable one RF port only when its active internal-sine AM, FM, or PM profile exactly matches the requested bounded profile; it does not configure modulation or restore RF OFF.
  - rf_source.modulation_configure
      required: port_id, modulation_kind, internal_frequency_hz
      optional : depth_percent, frequency_deviation_hz, on_failure, phase_deviation_rad, safety_gate
      note     : Configure one OFF RF port with an internal-sine AM, FM, or PM profile; it does not enable RF output.
  - rf_source.modulation_disable
      required: port_id, modulation_kind
      optional : on_failure, safety_gate
      note     : Disable one known active internal-sine AM, FM, or PM mode while RF output is OFF; an already consistent disabled state makes no write.
  - rf_source.output_disable
      required: port_id
      optional : on_failure, safety_gate
      note     : Disable one RF port and confirm OFF without requiring frequency, power, or protection readback.
  - rf_source.output_enable
      required: port_id
      optional : on_failure, safety_gate
      note     : Enable one RF port only after a fresh safety snapshot confirms the configured load, frequency, power, and inactive modulation, Pulse, Sweep, and blocking protection conditions.
  - rf_source.pulse_configure
      required: port_id, period_s, width_s, polarity
      optional : on_failure, safety_gate
      note     : Configure one OFF RF port with a disabled internal single-pulse profile; it does not enable RF output or trigger a pulse.
  - rf_source.pulse_output_disable
      required: port_id, interface_id
      optional : -
  - rf_source.pulse_output_enable
      required: port_id, interface_id
      optional : -
  - rf_source.set_frequency
      required: port_id, frequency_hz
      optional : on_failure, safety_gate
      note     : Set one RF port frequency while its output, modulation, Pulse, and Sweep are OFF.
  - rf_source.set_power_dbm
      required: port_id, power_dbm
      optional : on_failure, safety_gate
      note     : Set one RF port dBm level while its output, modulation, Pulse, and Sweep are OFF.
  - rf_source.status
      required: -
      optional : on_failure, safety_gate
      note     : Read a typed RF-source snapshot without changing output.
  - rf_source.sweep_configure
      required: port_id, start_frequency_hz, stop_frequency_hz, points, dwell_s
      optional : on_failure, safety_gate
      note     : Configure one OFF RF port with a disabled frequency-only Step Sweep profile; it does not arm, fire, trigger, or enable RF output.
  - rf_source.trigger_status
      required: port_id
      optional : on_failure, safety_gate
      note     : Read declared logical Pulse and Sweep trigger configuration without changing RF or trigger state.
  - scope.auto
      required: -
      optional : on_failure, safety_gate
      note     : Explicit RTM2032 AUToscale. It changes front-panel settings and is never inserted implicitly.
  - scope.capture
      required: -
      optional : auto_recover, autoscale_before_capture, autoscale_settle_s, channel, channels, expect, expect_fft, expect_frequency_hz, frequency_tolerance, label, on_failure, points, quality_gate, safety_gate, save_csv, save_npy, screenshot, synchronized, target_cycles, target_vpp, time_range_s, vertical_scale_v_per_div, window_frequency_hz
      note     : Trigger one acquisition, write a capture package, and optionally evaluate quality/expect checks. Use target_vpp or vertical_scale_v_per_div to fit the waveform vertically before capture.
  - sleep
      required: duration_s
      optional : on_failure, safety_gate
      note     : Wait between hardware actions.
  - source.arb_load
      required: file, frequency_hz, amplitude_vpp
      optional : byte_order, channel, max_points, offset_v, on_failure, output_on, safety_gate, sample_rate_hz
      note     : Upload a DG4202 arbitrary waveform from CSV/NPY using DATA:DAC VOLATILE; output remains unchanged unless output_on = true.
  - source.arbitrary_select_v2
      required: channel, slot_id, playback_mode
      optional : on_failure, playback_frequency_hz, safety_gate, sample_rate_hz
      note     : Select one named Source V2 ARB waveform while the target output is OFF; it does not enable output.
  - source.arbitrary_storage_v2
      required: channel, slot_id, file, write_mode
      optional : expected_previous_sha256, on_failure, safety_gate
      note     : Write one named Source V2 ARB storage slot without selecting or enabling it. The payload file is recorded by digest only.
  - source.arbitrary_volatile_replace_v2
      required: channel, file, point_count
      optional : on_failure, safety_gate
      note     : Replace one volatile Source V2 ARB workspace while output is OFF. The previous workspace content is not recoverable; the payload file is recorded by digest only.
  - source.arbitrary_workspace_volatile_replace_v2
      required: file, point_count
      optional : on_failure, safety_gate
      note     : Replace one unscoped volatile Source V2 ARB workspace only while every topology output is OFF. It does not identify an affected channel; the previous workspace content is not recoverable and the payload file is recorded by digest only.
  - source.basic_configure_v2
      required: channel
      optional : amplitude_vpp, frequency_hz, offset_v, on_failure, safety_gate, square_duty_cycle_percent, waveform_kind
      note     : Configure one Source V2 channel while its output is OFF. At least one basic field is required.
  - source.basic_live_configure_v2
      required: channel
      optional : amplitude_vpp, frequency_hz, on_failure, safety_gate
      note     : Change exactly one declared frequency or Vpp field while one Source V2 channel remains enabled.
  - source.burst_configure_v2
      required: channel, cycles, phase_deg, internal_period_s, delay_s
      optional : on_failure, safety_gate
      note     : Configure one OFF Source V2 channel with an internal Triggered Burst; it does not enable or fire output.
  - source.combine_configure_v2
      required: channels, enabled
      optional : on_failure, safety_gate
      note     : Enable or disable one declared Source V2 Combine relation while every affected output is OFF.
  - source.counter_configure_v2
      required: input_id
      optional : attenuation, coupling, impedance_ohm, on_failure, safety_gate, statistics_enabled, trigger_level_v
      note     : Configure exactly one declared Source V2 Counter field without enabling the Counter.
  - source.counter_disable_v2
      required: input_id
      optional : on_failure, safety_gate
      note     : Disable one declared Source V2 Counter input without changing its configuration.
  - source.counter_enable_v2
      required: input_id
      optional : on_failure, safety_gate
      note     : Enable one declared Source V2 Counter input after a fresh V2 readback.
  - source.counter_measure_v2
      required: input_id
      optional : on_failure, safety_gate
      note     : Read one already-enabled Source V2 Counter input without changing its configuration.
  - source.coupling_configure_v2
      required: channels, enabled
      optional : on_failure, safety_gate
      note     : Enable or disable one declared Source V2 Coupling relation while every affected output is OFF.
  - source.harmonics_configure_v2
      required: channel, order, preset
      optional : on_failure, safety_gate
      note     : Configure one OFF Source V2 channel with a declared Harmonic preset; it does not enable output.
  - source.harmonics_disable_v2
      required: channel
      optional : on_failure, safety_gate
      note     : Disable Harmonic on one OFF Source V2 channel; it does not enable output.
  - source.modulation_configure_v2
      required: channel, depth_percent, internal_frequency_hz
      optional : on_failure, safety_gate
      note     : Configure one OFF Source V2 channel with internal sine AM; it does not enable output.
  - source.modulation_fm_configure_v2
      required: channel, frequency_deviation_hz, internal_frequency_hz
      optional : on_failure, safety_gate
      note     : Configure one OFF Source V2 channel with internal sine FM; it does not enable output.
  - source.modulation_pm_configure_v2
      required: channel, phase_deviation_deg, internal_frequency_hz
      optional : on_failure, safety_gate
      note     : Configure one OFF Source V2 channel with internal sine PM; it does not enable output.
  - source.modulation_pwm_configure_v2
      required: channel, internal_frequency_hz
      optional : duty_deviation_percent, on_failure, safety_gate, width_deviation_s
      note     : Configure one OFF Source V2 channel with internal sine PWM; it does not enable output.
  - source.output
      required: state
      optional : channel, on_failure, safety_gate
      note     : Turn source channel output on or off.
  - source.output_disable_v2
      required: channel
      optional : on_failure, safety_gate
      note     : Turn one Source V2 channel output off without requiring Vpp or offset readback.
  - source.output_enable_v2
      required: channel
      optional : on_failure, safety_gate
      note     : Turn one Source V2 channel output on after a fresh V2 readback.
  - source.phase_relation_configure_v2
      required: channels, enabled
      optional : on_failure, safety_gate
      note     : Enable or disable one declared Source V2 phase relation while every affected output is OFF.
  - source.pulse_configure_v2
      required: channel, width_s, delay_s, leading_transition_s, trailing_transition_s
      optional : on_failure, safety_gate
      note     : Configure one OFF Source V2 channel with a WIDTH pulse shape; it does not enable output.
  - source.set_duty
      required: duty_percent
      optional : channel, on_failure, safety_gate
      note     : Set square-wave duty cycle in percent; valid range is 0 < duty_percent < 100.
  - source.set_freq
      required: frequency_hz
      optional : channel, on_failure, safety_gate
      note     : Set fixed source frequency in Hz; config may force FIX mode first.
  - source.set_func
      required: function
      optional : channel, on_failure, safety_gate
      note     : Set source waveform function, for example SIN or SQU.
  - source.set_vpp
      required: value_vpp
      optional : channel, on_failure, safety_gate
      note     : Set source amplitude in Vpp.
  - source.status
      required: -
      optional : channel, on_failure, safety_gate
      note     : Read signal-generator channel state without changing output.
  - source.sweep_configure_v2
      required: channel, start_hz, stop_hz, spacing, steps, sweep_time_s
      optional : on_failure, safety_gate, trigger_source
      note     : Configure one OFF Source V2 channel with an internal sweep; it does not enable or fire output.
  - source.sweep_fire_v2
      required: channel
      optional : on_failure, safety_gate
      note     : Fire one already configured manual Source V2 sweep in the same run session; external measurement is still required.
  - source.tracking_configure_v2
      required: channels, enabled
      optional : on_failure, safety_gate
      note     : Enable or disable one declared Source V2 Tracking relation while every affected output is OFF.
  - sweep.frequency_response
      required: reference_channel, response_channel
      optional : adaptive, amplitudes_vpp, autoscale_each_amplitude, baseline, calibration, fit, frequencies_hz, frequency_count, frequency_tolerance, label, min_signal_vpp, on_failure, points, resume_from, retry_warning_with_autoscale, safety_gate, save_csv, screenshot, settle_s, source_channel, spacing, start_frequency_hz, start_vpp, stop_conditions, stop_frequency_hz, stop_vpp, target_cycles, vpp_step
      note     : Sweep a source through discrete frequencies, capture reference and response channels in one acquisition per point, and write a Bode response CSV.

[steps.expect] metrics:
  scope.capture checks any numeric key from the capture quality summary with { min = ..., max = ... }.
  Common scope metrics: frequency_estimate_hz, frequency_error_ratio, voltage_vpp_v, voltage_mean_v, duty_cycle.
  dmm.read checks numeric keys from the DMM reading payload. Common DMM metric: value.

scope.capture [steps.expect_fft] metrics:
  FFT checks analyze the saved NPY waveform.
  Common metrics: peak_frequency_hz, peak_amplitude_v, thd_ratio, harmonic_2_amplitude_v.

analysis.pipeline metrics:
  Optional [steps.resources] tightens the execution resource profile; --analysis-resources selects an explicit environment TOML profile.
  Default resource admission bounds FIR taps, FFT length, working-set estimate, cumulative work/output and file counts before allocation. Actual source length is checked offline after capture.
  Time domain: voltage_min_v, voltage_max_v, voltage_mean_v, voltage_rms_v, voltage_vpp_v.
  Frequency domain: peak_frequency_hz, peak_amplitude_v, noise_floor_v, thd_ratio, and harmonic_2 through harmonic_5 frequency/amplitude fields.
  PSD domain: measure_band requires name, band_hz, exclude_hz and metrics=mean_square_v2|rms_v|noise_rms_v. Metric keys are <name>_<metric>.

  scope.capture synchronized=true requires channels=[1,2], save_npy=true and DEF points; single-channel quality/auto-retry fields are not accepted. Requires scope.capture_synchronized capability.
analysis.pair: reference_channel and response_channel must be distinct; source uses one earlier scope.capture with explicit save_npy=true.
  Pair operations: delay (integer lag), transfer (mean Welch H1/coherence), export. Synthetic and driver_frozen_single evidence are accepted.
  spectral_quality requires explicit integration bands, fundamental mode, harmonic orders, detection thresholds and metrics; only mean Welch PSD is accepted.
  Quality metrics: snr_db, sinad_db, sfdr_db, thdn_ratio, fundamental_frequency_hz, fundamental_power_v2, harmonic_power_v2, noise_power_v2, noise_bandwidth_hz, spur_frequency_hz, spur_power_v2, spur_dbc.
analysis.pipeline PSD operation:
  psd requires method=welch, window=hann|hamming|blackman, nperseg>=4, 0<=noverlap<nperseg, nfft>=nperseg, detrend=none|constant|linear, average=mean|median.
  All parameters are explicit; lengths are integers. Segment windows are periodic.
  Requires time data before window or fft. Only export, measure_band, spectral_quality or peaks may follow psd; at least one PSD result is required.
  Requires optional SciPy. Exports frequency_hz,psd_v2_per_hz with one-sided density scaling.
  peaks requires name, polarity=positive|negative|both, height>=0, prominence>=0, distance>0, width>=0, max_peaks=1..10000, metrics=[count].
  Peak distance/width use seconds in time and Hz in spectra; spectral polarity must be positive. Produces <name>_count and JSON/CSV tables without changing signal domain.
  smooth requires method=moving_average|savgol, odd window_length=3..1001, mode=centered|causal, boundary=reflect|edge. Causal requires edge.
  savgol requires polyorder=0..min(5,window_length-1); moving_average rejects polyorder. Smooth requires uniform time data before window/fft/psd.
  resample requires positive integer up/down (reduced factors <=10000), window=kaiser, beta=0..30, padtype=constant|line. Output is limited to 20000000 samples.
  Resample requires uniform time data before window/fft/psd; preserves time origin, uses a pinned polyphase FIR design and updates downstream sampling metadata.