File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,8 @@ def registration(self):
162
162
def registration (self , value ):
163
163
if value in {"gridline" , "pixel" }: # Support for string-type values
164
164
value = GridReg [value .upper ()]
165
- if value not in GridReg :
165
+ # Can be simplified to `if value not in GridReg` after requiring Python 3.12+.
166
+ if value not in GridReg .__members__ .values ():
166
167
msg = (
167
168
f"Invalid grid registration: { value } . "
168
169
"Should be either GridReg.GRIDLINE or GridReg.PIXEL."
@@ -182,7 +183,8 @@ def gtype(self):
182
183
def gtype (self , value ):
183
184
if value in {"cartesian" , "geographic" }: # Support for string-type values
184
185
value = GridType [value .upper ()]
185
- if value not in GridType :
186
+ # Can be simplified to `if value not in GridType` after requiring Python 3.12+.
187
+ if value not in GridType .__members__ .values ():
186
188
msg = (
187
189
f"Invalid grid coordinate system type: '{ value } '. "
188
190
"Should be either GridType.CARTESIAN or GridType.GEOGRAPHIC."
You can’t perform that action at this time.
0 commit comments