Metadata

class Metadata

Bases: CommonBaseModel

A metadata model for storing and managing key-value pairs.

key

The key of the metadata entry.

Type:

str

value

The value associated with the key.

Type:

Any

units

The units of measure for the data.

Type:

Optional[str]

uncertainty

The uncertainty associated with the data.

Type:

Optional[Any]

lower_bounds

The lower bounds of the data.

Type:

Optional[List[Bounds]]

upper_bounds

The upper bounds of the data.

Type:

Optional[List[Bounds]]

Attributes Summary

model_config

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

Methods Summary

key_must_be_non_empty(key)

Ensure the key is non-empty and within specified length limits.

Attributes Documentation

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': (), 'str_max_length': 255, 'str_min_length': 1, 'str_strip_whitespace': True, 'validate_assignment': True}

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

Methods Documentation

classmethod key_must_be_non_empty(key)

Ensure the key is non-empty and within specified length limits.

Parameters:

key (str) – The key to validate.

Returns:

The validated key.

Return type:

str

Raises:

ValueError – If the key is empty or exceeds the specified length limits.

Methods:

key_must_be_non_empty(key)

Ensure the key is non-empty and within specified length limits.

Attributes:

__pydantic_setattr_handlers__

__setattr__ handlers.

class Config

Bases: object

Pydantic configuration for the Metadata model.

classmethod key_must_be_non_empty(key)

Ensure the key is non-empty and within specified length limits.

Parameters:

key (str) – The key to validate.

Returns:

The validated key.

Return type:

str

Raises:

ValueError – If the key is empty or exceeds the specified length limits.

__pydantic_setattr_handlers__: ClassVar[Dict[str, Callable[[BaseModel, str, Any], None]]] = {}

__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__