diff --git a/niche_vlaanderen/codetables.py b/niche_vlaanderen/codetables.py index 04d81b3c..fe31be89 100644 --- a/niche_vlaanderen/codetables.py +++ b/niche_vlaanderen/codetables.py @@ -45,7 +45,11 @@ def check_lower_upper_boundaries(df, min_col, max_col, value): """ group_cols = set(df.columns.tolist()) - {min_col, max_col, value} - for sel_group, subtable in df.groupby(list(group_cols)): + if len(list(group_cols)) > 0: + groups = list(group_cols) + else: + groups = list(group_cols)[0] + for sel_group, subtable in df.groupby(groups): min_values = subtable[min_col] max_values = subtable[max_col] for (i, index) in enumerate(min_values.index): diff --git a/tests/test_validation.py b/tests/test_validation.py index 66776a65..3cd35d0b 100644 --- a/tests/test_validation.py +++ b/tests/test_validation.py @@ -11,6 +11,7 @@ def test_validation(zwarte_beek_niche, path_testdata): myniche = zwarte_beek_niche() + myniche.name = "zwarte beek" myniche.run() no = NicheValidation(