From d06bb73dbd9bb0b3a3ce0c42d1199858549a7bd1 Mon Sep 17 00:00:00 2001 From: Abodi Massarwa Date: Mon, 22 Jul 2024 17:54:27 +0300 Subject: [PATCH] modified validate_input () --- .../heterogeneous_matroid_constraints_algorithms.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fairpyx/algorithms/heterogeneous_matroid_constraints_algorithms.py b/fairpyx/algorithms/heterogeneous_matroid_constraints_algorithms.py index ed25d5a..62fb807 100644 --- a/fairpyx/algorithms/heterogeneous_matroid_constraints_algorithms.py +++ b/fairpyx/algorithms/heterogeneous_matroid_constraints_algorithms.py @@ -1132,8 +1132,8 @@ def check_required_keys(required_keys): bundles = kwargs['bundles'] if isinstance(bundles, dict): for key, val in bundles.items(): - if not isinstance(key, str) or not isinstance(val, list): - raise ValueError("Bundles not structured properly.") + if not isinstance(key, str) or not isinstance(val, (list,set)): + raise ValueError(f"Bundles not structured properly.{bundles} type(va;) -> {type(val)}") if not callable(kwargs['val_func']): raise ValueError("val_func must be callable.") if not isinstance(kwargs['source'], str) or not isinstance(kwargs['target'], str): @@ -1162,8 +1162,8 @@ def check_required_keys(required_keys): bundles = kwargs['bundles'] if isinstance(bundles, dict): for key, val in bundles.items(): - if not isinstance(key, str) or not isinstance(val, list): - raise ValueError("Bundles not structured properly.") + if not isinstance(key, str) or not isinstance(val, (list,set)): + raise ValueError(f"Bundles not structured properly.{bundles} type(va;) -> {type(val)}") if not callable(kwargs['valuation_func']): raise ValueError("valuation_func must be callable.") if not isinstance(kwargs['envy_graph'], nx.DiGraph):