nidaqlib.config¶
nidaqlib.config ¶
Process-wide configuration for :mod:nidaqlib.
Plain frozen dataclass, no validation library — keeps the core install free
of optional deps. Env-var coercion lives in :func:config_from_env.
Design reference: docs/design.md §18.1.
NidaqConfig
dataclass
¶
NidaqConfig(
*,
default_timeout_s=10.0,
default_sample_rate_hz=1000.0,
default_buffer_size=16,
default_chunk_size=1000,
eager_tasks=False,
)
Process-wide default settings.
Anything that varies per task (channel ranges, trigger source, TDMS
path) belongs on :class:~nidaqlib.tasks.TaskSpec, not here.
Attributes:
| Name | Type | Description |
|---|---|---|
default_timeout_s |
float
|
Fallback NI read/write timeout, in seconds. Used when the call site does not supply one explicitly. |
default_sample_rate_hz |
float
|
Fallback |
default_buffer_size |
int
|
AnyIO send-stream capacity for |
default_chunk_size |
int
|
Samples per channel per emitted |
eager_tasks |
bool
|
Opt-in to |
config_from_env ¶
Best-effort env loader.
Only reads well-known keys. Missing or unparseable values fall back to
:class:NidaqConfig's defaults — this function never raises.
Recognised keys (with prefix="NIDAQLIB_"):
NIDAQLIB_DEFAULT_TIMEOUT_S— float secondsNIDAQLIB_DEFAULT_SAMPLE_RATE_HZ— float HzNIDAQLIB_DEFAULT_BUFFER_SIZE— int slotsNIDAQLIB_DEFAULT_CHUNK_SIZE— int samplesNIDAQLIB_EAGER_TASKS—"1"/"true"/"yes"
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prefix
|
str
|
Prefix to prepend to each env key. Defaults to
|
DEFAULT_ENV_PREFIX
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
NidaqConfig
|
class: |