# {py:mod}`haniwers.v1.cli.threshold`

```{py:module} haniwers.v1.cli.threshold
```

```{autodoc2-docstring} haniwers.v1.cli.threshold
:allowtitles:
```

## Module Contents

### Functions

````{list-table}
:class: autosummary longtable
:align: left

* - {py:obj}`_apply_overrides <haniwers.v1.cli.threshold._apply_overrides>`
  - ```{autodoc2-docstring} haniwers.v1.cli.threshold._apply_overrides
    :summary:
    ```
* - {py:obj}`count_hits_by_channel <haniwers.v1.cli.threshold.count_hits_by_channel>`
  - ```{autodoc2-docstring} haniwers.v1.cli.threshold.count_hits_by_channel
    :summary:
    ```
* - {py:obj}`get_all_thresholds <haniwers.v1.cli.threshold.get_all_thresholds>`
  - ```{autodoc2-docstring} haniwers.v1.cli.threshold.get_all_thresholds
    :summary:
    ```
* - {py:obj}`write <haniwers.v1.cli.threshold.write>`
  - ```{autodoc2-docstring} haniwers.v1.cli.threshold.write
    :summary:
    ```
* - {py:obj}`serial <haniwers.v1.cli.threshold.serial>`
  - ```{autodoc2-docstring} haniwers.v1.cli.threshold.serial
    :summary:
    ```
* - {py:obj}`parallel <haniwers.v1.cli.threshold.parallel>`
  - ```{autodoc2-docstring} haniwers.v1.cli.threshold.parallel
    :summary:
    ```
````

### Data

````{list-table}
:class: autosummary longtable
:align: left

* - {py:obj}`app <haniwers.v1.cli.threshold.app>`
  - ```{autodoc2-docstring} haniwers.v1.cli.threshold.app
    :summary:
    ```
````

### API

````{py:data} app
:canonical: haniwers.v1.cli.threshold.app
:value: >
   'Typer(...)'

```{autodoc2-docstring} haniwers.v1.cli.threshold.app
```

````

````{py:function} _apply_overrides(config, overrides: dict) -> None
:canonical: haniwers.v1.cli.threshold._apply_overrides

```{autodoc2-docstring} haniwers.v1.cli.threshold._apply_overrides
```
````

````{py:function} count_hits_by_channel(events: list[haniwers.v1.daq.model.RawEvent]) -> dict[str, int]
:canonical: haniwers.v1.cli.threshold.count_hits_by_channel

```{autodoc2-docstring} haniwers.v1.cli.threshold.count_hits_by_channel
```
````

````{py:function} get_all_thresholds(sensors: dict[str, haniwers.v1.config.model.SensorConfig]) -> dict[str, int | None]
:canonical: haniwers.v1.cli.threshold.get_all_thresholds

```{autodoc2-docstring} haniwers.v1.cli.threshold.get_all_thresholds
```
````

````{py:function} write(ctx: typer.Context, config: typing.Optional[pathlib.Path] = ConfigOptions.config, port: typing.Optional[str] = DeviceOptions.port, baudrate: typing.Optional[int] = DeviceOptions.baudrate, timeout: typing.Optional[float] = DeviceOptions.timeout, device_label: typing.Optional[str] = DeviceOptions.device_label, thresholds: str = ThresholdOptions.thresholds, max_retry: int = ThresholdOptions.max_retry, history: pathlib.Path = ThresholdOptions.history, workspace: typing.Optional[pathlib.Path] = OutputOptions.workspace, filename_prefix: typing.Optional[str] = OutputOptions.filename_prefix, filename_suffix: typing.Optional[str] = OutputOptions.filename_suffix, events_per_file: typing.Optional[int] = SamplerOptions.events_per_file, number_of_files: typing.Optional[int] = SamplerOptions.number_of_files, stream_mode: bool = SamplerOptions.stream_mode, mock: bool = TestingOptions.mock, verbose: bool = LoggerOptions.verbose, logfile: str = LoggerOptions.logfile) -> None
:canonical: haniwers.v1.cli.threshold.write

```{autodoc2-docstring} haniwers.v1.cli.threshold.write
```
````

````{py:function} serial(ctx: typer.Context, config: typing.Optional[pathlib.Path] = ConfigOptions.config, port: typing.Optional[str] = DeviceOptions.port, baudrate: typing.Optional[int] = DeviceOptions.baudrate, timeout: typing.Optional[float] = DeviceOptions.timeout, device_label: typing.Optional[str] = DeviceOptions.device_label, thresholds: str = ThresholdOptions.thresholds, suppress_threshold: int = ThresholdOptions.suppress_threshold, max_retry: int = ThresholdOptions.max_retry, history: pathlib.Path = ThresholdOptions.history, nsteps: int = ScanOptions.nsteps, step: int = ScanOptions.step, duration: float = ScanOptions.duration, workspace: typing.Optional[pathlib.Path] = OutputOptions.workspace, filename_prefix: typing.Optional[str] = OutputOptions.filename_prefix, filename_suffix: typing.Optional[str] = OutputOptions.filename_suffix, events_per_file: typing.Optional[int] = SamplerOptions.events_per_file, number_of_files: typing.Optional[int] = SamplerOptions.number_of_files, stream_mode: bool = SamplerOptions.stream_mode, mock: bool = TestingOptions.mock, verbose: bool = LoggerOptions.verbose, logfile: str = LoggerOptions.logfile) -> None
:canonical: haniwers.v1.cli.threshold.serial

```{autodoc2-docstring} haniwers.v1.cli.threshold.serial
```
````

````{py:function} parallel(ctx: typer.Context, config: typing.Optional[pathlib.Path] = ConfigOptions.config, port: typing.Optional[str] = DeviceOptions.port, baudrate: typing.Optional[int] = DeviceOptions.baudrate, timeout: typing.Optional[float] = DeviceOptions.timeout, device_label: typing.Optional[str] = DeviceOptions.device_label, thresholds: str = ThresholdOptions.thresholds, max_retry: int = ThresholdOptions.max_retry, history: pathlib.Path = ThresholdOptions.history, nsteps: int = ScanOptions.nsteps, step: int = ScanOptions.step, duration: float = ScanOptions.duration, workspace: typing.Optional[pathlib.Path] = OutputOptions.workspace, filename_prefix: typing.Optional[str] = OutputOptions.filename_prefix, filename_suffix: typing.Optional[str] = OutputOptions.filename_suffix, events_per_file: typing.Optional[int] = SamplerOptions.events_per_file, number_of_files: typing.Optional[int] = SamplerOptions.number_of_files, stream_mode: bool = SamplerOptions.stream_mode, mock: bool = TestingOptions.mock, verbose: bool = LoggerOptions.verbose, logfile: str = LoggerOptions.logfile) -> None
:canonical: haniwers.v1.cli.threshold.parallel

```{autodoc2-docstring} haniwers.v1.cli.threshold.parallel
```
````
