Skip to content

Commit 30e1245

Browse files
Moving ValueError when no vector_interp_method to top of initi
1 parent f1ce1e8 commit 30e1245

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/parcels/_core/field.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,10 @@ def __init__(
247247
W: Field | None = None, # noqa: N803
248248
vector_interp_method: Callable | None = None,
249249
):
250-
_assert_str_and_python_varname(name)
250+
if vector_interp_method is None:
251+
raise ValueError("vector_interp_method must be provided for VectorField initialization.")
251252

253+
_assert_str_and_python_varname(name)
252254
self.name = name
253255
self.U = U
254256
self.V = V
@@ -268,8 +270,6 @@ def __init__(
268270
else:
269271
self.vector_type = "2D"
270272

271-
if vector_interp_method is None:
272-
raise ValueError("vector_interp_method must be provided for VectorField initialization.")
273273
assert_same_function_signature(vector_interp_method, ref=ZeroInterpolator_Vector, context="Interpolation")
274274
self._vector_interp_method = vector_interp_method
275275

0 commit comments

Comments
 (0)