mt_metadata.transfer_functions.io.emtfxml.metadata.period_range

Classes

PeriodRange

Base class for all metadata objects with Pydantic validation.

Module Contents

class mt_metadata.transfer_functions.io.emtfxml.metadata.period_range.PeriodRange(**data)

Bases: mt_metadata.base.MetadataBase

Base class for all metadata objects with Pydantic validation.

MetadataBase extends DotNotationBaseModel (which inherits from Pydantic’s BaseModel) to provide automatic validation according to metadata standards. It adds functionality beyond dictionaries, supporting JSON, XML, pandas Series, and other formats for metadata interchange.

_skip_equals

Private attribute listing fields to skip in equality comparisons

Type:

list[str]

_fields

Private attribute caching field information

Type:

dict[str, Any]

Notes

  • All field assignments are validated automatically via Pydantic

  • None values are converted to appropriate defaults (empty string or 0.0)

  • Supports nested attribute access via dot notation

  • Thread-safe for read operations after initialization

min: Annotated[float, Field(default=0.0, description='minimum period', alias=None, json_schema_extra={'units': 'samples per second', 'required': True, 'examples': ['"4.5E-5"']})]
max: Annotated[float, Field(default=0.0, description='maxmimu period', alias=None, json_schema_extra={'units': 'samples per second', 'required': True, 'examples': ['"4.5E5"']})]
read_dict(input_dict)

Read the period_range element from the input dictionary.

Parameters:

input_dict (dict) – The input dictionary containing the period_range element.

to_xml(string=False, required=True)

Convert the period_range element to XML.

Parameters:
  • string (bool, optional) – Whether to return the XML as a string, by default False

  • required (bool, optional) – Whether the element is required, by default True

Returns:

The XML representation of the period_range element.

Return type:

et.Element | str