Coverage for C: \ Users \ peaco \ OneDrive \ Documents \ GitHub \ mt_metadata \ mt_metadata \ timeseries \ electric.py: 100%

14 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, PrivateAttr 

7 

8from mt_metadata.common import StartEndRange 

9from mt_metadata.timeseries import ChannelBase, Electrode 

10 

11 

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

13class Electric(ChannelBase): 

14 _channel_type: str = PrivateAttr("electric") 

15 

16 component: Annotated[ 

17 str, 

18 Field( 

19 default="e_default", 

20 description="Component of the electric field.", 

21 alias=None, 

22 pattern=r"^[eE][a-zA-Z0-9_]*$", 

23 json_schema_extra={ 

24 "units": None, 

25 "required": True, 

26 "examples": ["Ex"], 

27 }, 

28 ), 

29 ] 

30 

31 dipole_length: Annotated[ 

32 float, 

33 Field( 

34 default=0.0, 

35 description="Length of the dipole as measured in a straight line from electrode to electrode.", 

36 alias=None, 

37 json_schema_extra={ 

38 "units": "meters", 

39 "required": True, 

40 "examples": ["55.25"], 

41 }, 

42 ), 

43 ] 

44 

45 positive: Annotated[ 

46 Electrode, 

47 Field( 

48 default_factory=Electrode, 

49 description="Positive electrode.", 

50 alias=None, 

51 json_schema_extra={ 

52 "units": None, 

53 "required": True, 

54 "examples": ["Electrode()"], 

55 }, 

56 ), 

57 ] 

58 

59 negative: Annotated[ 

60 Electrode, 

61 Field( 

62 default_factory=Electrode, 

63 description="Negative electrode.", 

64 alias=None, 

65 json_schema_extra={ 

66 "units": None, 

67 "required": True, 

68 "examples": ["Electrode()"], 

69 }, 

70 ), 

71 ] 

72 

73 contact_resistance: Annotated[ 

74 StartEndRange, 

75 Field( 

76 default_factory=StartEndRange, 

77 description="Contact resistance start and end values.", 

78 alias=None, 

79 json_schema_extra={ 

80 "units": None, 

81 "required": True, 

82 "examples": ["StartEndRange()"], 

83 }, 

84 ), 

85 ] 

86 

87 ac: Annotated[ 

88 StartEndRange, 

89 Field( 

90 default_factory=StartEndRange, 

91 description="AC start and end values.", 

92 alias=None, 

93 json_schema_extra={ 

94 "units": None, 

95 "required": True, 

96 "examples": ["StartEndRange()"], 

97 }, 

98 ), 

99 ] 

100 

101 dc: Annotated[ 

102 StartEndRange, 

103 Field( 

104 default_factory=StartEndRange, 

105 description="DC start and end values.", 

106 alias=None, 

107 json_schema_extra={ 

108 "units": None, 

109 "required": True, 

110 "examples": ["StartEndRange()"], 

111 }, 

112 ), 

113 ] 

114 

115 type: Annotated[ 

116 str, 

117 Field( 

118 default="electric", 

119 description="Data type for the channel, should be a descriptive word that a user can understand.", 

120 alias=None, 

121 json_schema_extra={ 

122 "units": None, 

123 "required": True, 

124 "examples": ["electric"], 

125 }, 

126 ), 

127 ]