From 9bc7925471ae311ee5438f7d57a73612ce028efd Mon Sep 17 00:00:00 2001 From: Abodi Massarwa Date: Mon, 22 Jul 2024 17:20:20 +0300 Subject: [PATCH] modified validate_input () --- .../algorithms/heterogeneous_matroid_constraints_algorithms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fairpyx/algorithms/heterogeneous_matroid_constraints_algorithms.py b/fairpyx/algorithms/heterogeneous_matroid_constraints_algorithms.py index 8fe38a4..e3ac171 100644 --- a/fairpyx/algorithms/heterogeneous_matroid_constraints_algorithms.py +++ b/fairpyx/algorithms/heterogeneous_matroid_constraints_algorithms.py @@ -17,6 +17,7 @@ import networkx as nx import matplotlib.pyplot as plt import logging +import numpy as np logger = logging.getLogger(__name__) @@ -1247,7 +1248,7 @@ def validate_valuations(agent_item_valuations: dict[str, dict[str, int]], is_ide if not isinstance(key,str) or not isinstance(value,dict): raise ValueError(f"agent_item_valuations {agent_item_valuations} isn't structured correctly") for inner_key,inner_value in value.items(): - if not isinstance(inner_key,str) or not isinstance(inner_value,int): + if not isinstance(inner_key,str) or not isinstance(inner_value,(int,np.int64)): raise ValueError(f"agent_item_valuations {agent_item_valuations} isn't structured correctly,inner value type is {type(inner_value)}") if is_identical: