From f008a3b77edc6149eb49953a3b37468c1e034ba5 Mon Sep 17 00:00:00 2001 From: Robert Wilson Date: Fri, 25 Oct 2024 12:06:23 +0100 Subject: [PATCH] throw error when no variables supplied --- ecoval/matchall.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ecoval/matchall.py b/ecoval/matchall.py index fd19960..fab5b33 100644 --- a/ecoval/matchall.py +++ b/ecoval/matchall.py @@ -652,6 +652,10 @@ def matchup( point_surface_req = copy.deepcopy(point_surface) benthic_req = copy.deepcopy(benthic) + # throw an error if all of these are empty + if len(surface) == 0 and len(bottom) == 0 and len(benthic) == 0: + raise ValueError("Please provide at least one variable to matchup") + if isinstance(exclude, str): exclude = [exclude]