@@ -57,7 +57,12 @@ def populate_demand(default_new_input, con, populate_regions, populate_commoditi
5757
5858@fixture
5959def populate_demand_slicing (
60- default_new_input , con , populate_regions , populate_commodities , populate_demand
60+ default_new_input ,
61+ con ,
62+ populate_regions ,
63+ populate_commodities ,
64+ populate_demand ,
65+ populate_timeslices ,
6166):
6267 from muse .new_input .readers import read_demand_slicing_csv
6368
@@ -84,7 +89,7 @@ def populate_timeslices(default_new_input, con):
8489def test_read_timeslices_csv (populate_timeslices ):
8590 data = populate_timeslices
8691 assert len (data ["id" ]) == 6
87- assert next (iter (data ["id" ])) == "1"
92+ assert next (iter (data ["id" ])) == 1
8893 assert next (iter (data ["season" ])) == "all"
8994 assert next (iter (data ["day" ])) == "all"
9095 assert next (iter (data ["time_of_day" ])) == "night"
@@ -202,7 +207,7 @@ def test_calculate_demand(
202207
203208 assert set (data .dims ) == {"year" , "commodity" , "region" , "timeslice" }
204209 assert list (data .coords ["region" ].values ) == ["R1" ]
205- assert list (data .coords ["timeslice" ].values ) == [ "1" , "2" , "3" , "4" , "5" , "6" ]
210+ assert set (data .coords ["timeslice" ].values ) == set ( range ( 1 , 7 ))
206211 assert list (data .coords ["year" ].values ) == [2020 , 2050 ]
207212 assert set (data .coords ["commodity" ].values ) == {
208213 "electricity" ,
@@ -212,7 +217,7 @@ def test_calculate_demand(
212217 "CO2f" ,
213218 }
214219
215- assert data .sel (year = 2020 , commodity = "heat" , region = "R1" , timeslice = "1" ) == 1
220+ assert data .sel (year = 2020 , commodity = "heat" , region = "R1" , timeslice = 1 ) == 1
216221
217222
218223@mark .xfail
0 commit comments