qat.purr.qatconfig module

class QatConfig(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_implicit_flags=None, _secrets_dir=None, **values)

Bases: BaseSettings

Full settings for a single job. Allows environment variables to be overridden by direct assignment.

>>> import os
>>> os.environ["QAT_MAX_REPEATS_LIMIT"] = "654321"
>>> QatConfig()
QatConfig(MAX_REPEATS_LIMIT=654321, DISABLE_PULSE_DURATION_LIMITS=False)
>>> QatConfig(MAX_REPEATS_LIMIT=123)
QatConfig(MAX_REPEATS_LIMIT=123, DISABLE_PULSE_DURATION_LIMITS=False)
>>> qatconfig = QatConfig()
>>> qatconfig.MAX_REPEATS_LIMIT = 16000
>>> qatconfig
QatConfig(MAX_REPEATS_LIMIT=16000, DISABLE_PULSE_DURATION_LIMITS=False)
>>> QatConfig(MAX_REPEATS_LIMIT=100.5) 
Traceback (most recent call last):
...
pydantic_core._pydantic_core.ValidationError
...
Input should be a valid integer, got a number with a fractional part

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

DISABLE_PULSE_DURATION_LIMITS: bool

Flag to disable the lower and upper pulse duration limits. Only needs to be set to True for calibration purposes.

MAX_REPEATS_LIMIT: Optional[int]

Max number of repeats / shots to be performed in a single job.

classmethod check_disable_pulse_duration_limits(DISABLE_PULSE_DURATION_LIMITS)
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[SettingsConfigDict] = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'cli_avoid_json': False, 'cli_enforce_required': False, 'cli_exit_on_error': True, 'cli_hide_none_type': False, 'cli_implicit_flags': False, 'cli_parse_args': None, 'cli_parse_none_str': None, 'cli_prefix': '', 'cli_prog_name': None, 'cli_settings_source': None, 'cli_use_class_docs_for_groups': False, 'env_file': None, 'env_file_encoding': None, 'env_ignore_empty': False, 'env_nested_delimiter': None, 'env_parse_enums': None, 'env_parse_none_str': None, 'env_prefix': 'QAT_', 'extra': 'forbid', 'json_file': None, 'json_file_encoding': None, 'nested_model_default_partial_update': False, 'protected_namespaces': ('model_', 'settings_'), 'secrets_dir': None, 'toml_file': None, 'validate_assignment': True, 'validate_default': True, 'yaml_file': None, 'yaml_file_encoding': None}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'DISABLE_PULSE_DURATION_LIMITS': FieldInfo(annotation=bool, required=False, default=False), 'MAX_REPEATS_LIMIT': FieldInfo(annotation=Union[int, NoneType], required=False, default=100000, metadata=[Gt(gt=0)])}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.