Skip to content

Commit b667739

Browse files
Apply suggestions from code review
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
1 parent c36ae0c commit b667739

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pygmt/src/earthtide.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,13 @@ def earthtide(**kwargs):
8383
>>> # Create a grid of Earth tide at 1200 UTC on June 18, 2018
8484
>>> grid = pygmt.earthtide(time="2018-06-18T12:00:00")
8585
"""
86-
if "R" in kwargs and "I" not in kwargs:
86+
if kwargs.get("R") is not None and kwargs.get("I") is None:
8787
raise GMTInvalidInput("Must specify 'spacing' if 'region' is specified.")
8888
with GMTTempFile(suffix=".nc") as tmpfile:
8989
with Session() as lib:
9090
if "G" not in kwargs: # if outgrid is unset, output to tempfile
9191
kwargs.update({"G": tmpfile.name})
9292
outgrid = kwargs["G"]
93-
arg_str = build_arg_string(kwargs)
94-
lib.call_module("earthtide", arg_str)
93+
lib.call_module("earthtide", build_arg_string(kwargs))
9594

9695
return load_dataarray(outgrid) if outgrid == tmpfile.name else None

0 commit comments

Comments
 (0)