From 826e16f0f2dcdbc7acdd32efa12d6bb02455d423 Mon Sep 17 00:00:00 2001 From: Galen Seilis Date: Sun, 16 Jun 2024 22:25:20 -0700 Subject: [PATCH] Update Probabilistic in routing.py Specialized the string in the ValueErrors. --- ciw/routing/routing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ciw/routing/routing.py b/ciw/routing/routing.py index 15a19ac..e0306df 100644 --- a/ciw/routing/routing.py +++ b/ciw/routing/routing.py @@ -199,11 +199,11 @@ def __init__(self, destinations, probs): """ for p in probs: if not isinstance(p, float): - raise ValueError("Routing probabilities must be between 0 and 1, and sum to less than 1.") + raise ValueError("Routing probabilities must be a float.") if p < 0 or p > 1: - raise ValueError("Routing probabilities must be between 0 and 1, and sum to less than 1.") + raise ValueError("Routing probabilities must be between 0 and 1.") if sum(probs) > 1.0: - raise ValueError("Routing probabilities must be between 0 and 1, and sum to less than 1.") + raise ValueError("Routing probabilities must sum to 1 or less.") self.destinations = destinations + [-1] self.probs = probs + [1 - sum(probs)]