Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pygmt/src/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ def __init__(

Doesn't apply to the conventions ``"aki"``, ``"gcmt"``, and ``"partial"``.
"""
# TODO(Python>=3.12): Simplify to "convention in _FocalMechanismConventionCode".
if convention in _FocalMechanismConventionCode.__members__.values():
if convention in _FocalMechanismConventionCode:
# Convention is specified via the actual single-letter convention code.
self.code = _FocalMechanismConventionCode(convention)
# Parse the convention from the convention code name.
Expand Down
6 changes: 2 additions & 4 deletions pygmt/xarray/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ def registration(self) -> GridRegistration:

@registration.setter
def registration(self, value: GridRegistration | int):
# TODO(Python>=3.12): Simplify to `if value not in GridRegistration`.
if value not in GridRegistration.__members__.values():
if value not in GridRegistration:
raise GMTValueError(
value, description="grid registration", choices=GridRegistration
)
Expand All @@ -225,8 +224,7 @@ def gtype(self) -> GridType:

@gtype.setter
def gtype(self, value: GridType | int):
# TODO(Python>=3.12): Simplify to `if value not in GridType`.
if value not in GridType.__members__.values():
if value not in GridType:
raise GMTValueError(
value, description="grid coordinate system type", choices=GridType
)
Expand Down
Loading