mt_metadata.transfer_functions.io.emtfxml.metadata.instrument

Created on Wed Dec 23 21:30:36 2020

copyright:

Jared Peacock (jpeacock@usgs.gov)

license:

MIT

Classes

Instrument

Base class for all metadata objects with Pydantic validation.

Module Contents

class mt_metadata.transfer_functions.io.emtfxml.metadata.instrument.Instrument(**data)

Bases: mt_metadata.common.Instrument

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

settings: Annotated[str | None, Field(default=None, description='Settings for the instrument, such as configuration or calibration details.', alias=None, json_schema_extra={'units': None, 'required': False, 'examples': ['calibration settings', 'configuration details']})] = None
to_xml(string=False, required=False)

Convert the Instrument object to an XML element or string. :param string: If True, return as a string; otherwise, return as an XML element. :type string: bool, optional :param required: If True, include only required fields; otherwise, include all fields. :type required: bool, optional :return: XML representation of the Instrument object. :rtype: str | et.Element