Skip to content

Commit 82204dd

Browse files
committed
minor improvements to arg errors
1 parent 80211b5 commit 82204dd

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

nctoolkit/verticals.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,22 +176,21 @@ def vertical_interp(
176176
if surface is None:
177177
raise ValueError("Please provide surface")
178178

179-
if fixed is None:
180-
if thickness is None:
181-
raise ValueError("You must provide the fixed arg")
182-
183179
if depths is None:
184180
if fixed is False:
185181
if thickness is None:
186-
raise ValueError("Please provide thickness")
182+
raise ValueError("Please provide thickness or depths")
183+
184+
if thickness is not None:
185+
fixed = False
186+
187+
if depths is not None:
188+
fixed = False
187189

188190
if not isinstance(fixed, bool):
189191
if thickness is None:
190192
raise TypeError("fixed must be a bool")
191193

192-
if thickness is not None:
193-
fixed = False
194-
195194
if isinstance(levels, (int, float)):
196195
levels = [levels]
197196

0 commit comments

Comments
 (0)