File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -190,15 +190,14 @@ def __init__(
190190
191191 Doesn't apply to the conventions ``"aki"``, ``"gcmt"``, and ``"partial"``.
192192 """
193- # TODO(Python>=3.12): Simplify to "convention in _FocalMechanismConventionCode".
194- if convention in _FocalMechanismConventionCode .__members__ .values ():
193+ if convention in _FocalMechanismConventionCode :
195194 # Convention is specified via the actual single-letter convention code.
196195 self .code = _FocalMechanismConventionCode (convention )
197196 # Parse the convention from the convention code name.
198197 self ._convention = "_" .join (self .code .name .split ("_" )[:- 1 ]).lower ()
199198 else : # Convention is specified via "convention" and "component".
200199 name = f"{ convention .upper ()} _{ component .upper ()} " # e.g., "AKI_DC"
201- if name not in _FocalMechanismConventionCode . __members__ :
200+ if name not in _FocalMechanismConventionCode :
202201 _value = f"convention='{ convention } ', component='{ component } '"
203202 raise GMTValueError (_value , description = "focal mechanism convention" )
204203 self .code = _FocalMechanismConventionCode [name ]
Original file line number Diff line number Diff line change @@ -209,8 +209,7 @@ def registration(self) -> GridRegistration:
209209
210210 @registration .setter
211211 def registration (self , value : GridRegistration | int ):
212- # TODO(Python>=3.12): Simplify to `if value not in GridRegistration`.
213- if value not in GridRegistration .__members__ .values ():
212+ if value not in GridRegistration :
214213 raise GMTValueError (
215214 value , description = "grid registration" , choices = GridRegistration
216215 )
@@ -225,8 +224,7 @@ def gtype(self) -> GridType:
225224
226225 @gtype .setter
227226 def gtype (self , value : GridType | int ):
228- # TODO(Python>=3.12): Simplify to `if value not in GridType`.
229- if value not in GridType .__members__ .values ():
227+ if value not in GridType :
230228 raise GMTValueError (
231229 value , description = "grid coordinate system type" , choices = GridType
232230 )
You can’t perform that action at this time.
0 commit comments