Skip to content

primitives

Primitive value types used across analysis configuration models.

Choices

Bases: RootModel

Represents a list of choices where all choises have the same type and are unique.

Each choice can be a string, integer, float, or boolean.

__getitem__(item)

Return the choice at the given index.

__iter__()

Return an iterator over the choices.

__len__()

Return the number of choices.

validate_choices(values) classmethod

Validate the choices.

Validate the choises and ensure that all choices have the same type and handles specification as root or 'choices' key in the dictionary.

validate_unique_choices()

Validate that all choices are unique.

Range

Bases: RootModel

Represents a range between a minimum and maximum value.

Both values are inclusive and the minimum value is less than or equal to the maximum value. A maximum value of None indicates that there is no upper limit (+inf). A minimum value of None indicates that there is no lower limit (-inf). String literals "+inf" and "-inf" are also allowed.

__contains__(item)

Check if the item is within the range.

__getitem__(item)

Return the value at the given index.

__iter__()

Return an iterator over the range values.

serialize_range()

Convert float(+/-inf) to string (+/-inf) for JSON serialization.

validate_range(values) classmethod

Validate the range values.

Validate the range values and handles conversion of string inf literals to floats and specification as root or 'range' key in the dictionary.

UserFriendlyNamedValue pydantic-model

Bases: BaseModel

Value with a user friendly name.

This is used to represent a value that can be presented to the user in a user-friendly way with a description of the value.

Fields:

description pydantic-field

Representation of the value of the choice to be presented to the user.

value pydantic-field

The value of the choice.

__eq__(other)

Check equality with another UserFriendlyNamedValue or a value.

__hash__()

Return a hash of the value.