mt_metadata.transfer_functions.io.emtfxml.metadata.site_layout

Classes

SiteLayout

Base class for all metadata objects with Pydantic validation.

Module Contents

class mt_metadata.transfer_functions.io.emtfxml.metadata.site_layout.SiteLayout(**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

input_channels: Annotated[list[mt_metadata.transfer_functions.io.emtfxml.metadata.Electric | mt_metadata.transfer_functions.io.emtfxml.metadata.Magnetic | str], Field(default_factory=list, description='list of input channels for transfer function estimation', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['[Magnetic(hx), Magnetic(hy)]']})]
output_channels: Annotated[list[mt_metadata.transfer_functions.io.emtfxml.metadata.Electric | mt_metadata.transfer_functions.io.emtfxml.metadata.Magnetic | str], Field(default_factory=list, description='list of output channels for transfer function estimation', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['[Electric(ex), Electric(ey), Magnetic(hz)]']})]
property input_channel_names: list[str]

Returns a list of input channel names.

property output_channel_names: list[str]

Returns a list of output channel names.

classmethod validate_channels(value)
read_dict(input_dict)

read site layout into the proper input/output channels

Parameters:

input_dict (dict) – input dictionary containing site layout data

Returns:

None

Return type:

None

to_xml(string=False, required=True)

Convert the SiteLayout instance to an XML representation.

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

  • required (bool, optional) – Whether the XML elements are required, by default True

Returns:

The XML representation of the SiteLayout instance

Return type:

str | et.Element