Coverage for C: \ Users \ peaco \ OneDrive \ Documents \ GitHub \ mt_metadata \ mt_metadata \ transfer_functions \ io \ emtfxml \ metadata \ primary_data.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-01-10 00:11 -0800

1# ===================================================== 

2# Imports 

3# ===================================================== 

4from typing import Annotated 

5 

6from pydantic import Field 

7 

8from mt_metadata.base import MetadataBase 

9from mt_metadata.transfer_functions.io.emtfxml.metadata import helpers 

10 

11 

12# ===================================================== 

13class PrimaryData(MetadataBase): 

14 filename: Annotated[ 

15 str, 

16 Field( 

17 default="", 

18 description="file name of the figure file that displays the data", 

19 alias=None, 

20 json_schema_extra={ 

21 "units": None, 

22 "required": True, 

23 "examples": ["example.png"], 

24 }, 

25 ), 

26 ] 

27 

28 def read_dict(self, input_dict: dict) -> None: 

29 """ 

30 Read the primary_data element from the input dictionary. 

31 

32 Parameters 

33 ---------- 

34 input_dict : dict 

35 The input dictionary containing the primary_data element. 

36 """ 

37 helpers._read_element(self, input_dict, "primary_data")