Skip to content

Commit f65207a

Browse files
committed
wall.read_geqdsk: Use in rather than hasattr
Checks for presence of "rlim" and "zlim" keys.
1 parent 1fa2c3c commit f65207a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xbout/wall.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def read_geqdsk(filehandle):
8383
data = geqdsk.read(filehandle)
8484
# rlim and zlim should be 1D arrays of wall coordinates
8585

86-
if not (hasattr(data, "rlim") and hasattr(data, "zlim")):
86+
if not (("rlim" in data) and ("zlim" in data)):
8787
raise ValueError(f"Wall coordinates not found in GEQDSK file")
8888

8989
return AxisymmetricWall(data["rlim"], data["zlim"])

0 commit comments

Comments
 (0)