Skip to content

Commit a34081c

Browse files
committed
Fix overly strict demand share check
1 parent 1537c1b commit a34081c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/muse/demand_share.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ def new_and_retro(
299299

300300
# Make sure the total new/retro agent quantity = 1
301301
# TODO: ideally we should check this in the input layer
302-
assert total_retro_quantity == 1
303-
assert total_new_quantity == 1
302+
assert abs(total_retro_quantity - 1) < 1e-2
303+
assert abs(total_new_quantity - 1) < 1e-2
304304

305305
result = agent_concatenation(agent_demands)
306306
assert "year" not in result.dims
@@ -399,7 +399,7 @@ def standard_demand(
399399

400400
# Make sure the total agent quantity = 1
401401
# TODO: ideally we should check this in the input layer
402-
assert total_quantity == 1
402+
assert abs(total_quantity - 1) < 1e-2
403403

404404
result = agent_concatenation(agent_demands)
405405
assert "year" not in result.dims

0 commit comments

Comments
 (0)