haniwers.v1.cli.options.sampler#

Sampler settings option group.

Module Contents#

Classes#

SamplerOptions

Sampler configuration option group.

API#

class haniwers.v1.cli.options.sampler.SamplerOptions#

Sampler configuration option group.

Contains all options for configuring data acquisition including acquisition mode (count_based/time_based), file management, output behavior, and configuration identity. These options correspond directly to SamplerConfig attributes for full CLI-to-config symmetry.

label#

‘Option(…)’

Sampler configuration label.

Human-readable identifier for this sampler configuration. Useful for organizing multiple configurations and tracking results. Examples: ‘main’, ‘scan_001’, ‘test_run’.

Corresponds to: SamplerConfig.label

Type: Optional[str] Default: None (use config file value)

events_per_file#

‘Option(…)’

Events per file rollover option.

Number of events to record before automatically starting a new output file. Helps manage file sizes. Set to 10000 to create a new file every 10k events.

Corresponds to: SamplerConfig.events_per_file

Type: Optional[int] Default: None (use config file value) Minimum: 1 event

number_of_files#

‘Option(…)’

Maximum files in session option.

Maximum number of output files to create during this session. Helps prevent unlimited disk usage. When reached, the oldest files may be overwritten.

Corresponds to: SamplerConfig.number_of_files

Type: Optional[int] Default: None (use config file value, typically unlimited) Minimum: 1 file

stream_mode#

‘Option(…)’

Streaming mode option.

When enabled, data is written immediately to disk without buffering. This is slower but ensures no data loss if the program crashes. Disable for better performance when data loss is acceptable.

Corresponds to: SamplerConfig.stream_mode

Type: bool Default: False (buffered mode)

mode#

‘Option(…)’

DAQ mode option.

Selects acquisition mode:

  • count_based: Collect a fixed number of events then stop

  • time_based: Run for a fixed time period then stop

Corresponds to: SamplerConfig.mode

Type: Optional[str] Default: None (use config file value, typically ‘count_based’) Valid values: ‘count_based’, ‘time_based’

duration#

‘Option(…)’

Duration option (flexible: acquisition or per-threshold measurement).

Context-dependent duration:

  • In DAQ/Write: Total acquisition time when mode=time_based

  • In Threshold Scanning: Measurement duration per threshold step

  • Automatically enables time_based mode when specified with DAQ

  • Overrides duration setting from config file

Corresponds to: SamplerConfig.duration

Type: Optional[float] Default: None (use config file value, typically time-based defaults to command defaults) Minimum: 0.1 seconds