cluster: add tolerance to country weight sum L
This commit is contained in:
parent
0ea5a5c28f
commit
3fd5c5d0e1
@ -176,7 +176,7 @@ def distribute_clusters(n, n_clusters, focus_weights=None, solver_name=None):
|
|||||||
|
|
||||||
logger.warning('Using custom focus weights for determining number of clusters.')
|
logger.warning('Using custom focus weights for determining number of clusters.')
|
||||||
|
|
||||||
assert L.sum() == 1.0, "Country weights L must sum up to 1.0 when distributing clusters."
|
assert np.isclose(L.sum(), 1.0, rtol=1e-3), "Country weights L must sum up to 1.0 when distributing clusters. Is {}.".format(L.sum())
|
||||||
|
|
||||||
m = po.ConcreteModel()
|
m = po.ConcreteModel()
|
||||||
def n_bounds(model, *n_id):
|
def n_bounds(model, *n_id):
|
||||||
|
Loading…
Reference in New Issue
Block a user