@@ -105,15 +105,25 @@ def test_resample_rule(self, example_houses):
105105 # Quarter-hourly data should have 4 times as many entries
106106 assert len (load_curves_quarter ) == len (load_curves_hourly ) * 4
107107
108- def test_leap_year (self ):
109- """Test handling of leap years."""
110- # region_leap = Region(2020, try_region=4) # Leap year
111- region_normal = Region (
112- 2017 , Climate ().from_try_data (4 )
113- ) # Non-leap year
114-
115- # assert region_leap.hoy == 8784 # Hours in leap year
116- assert region_normal .hoy == 8760 # Hours in normal year
108+ def test_leap_year (self , example_houses , example_holidays ):
109+ """Test generation of load curves for leap year."""
110+ climate = Climate ().from_try_data (4 )
111+ climate .temperature = pd .concat (
112+ [climate .temperature , climate .temperature .iloc [[- 1 ]]]
113+ )
114+ climate .cloud_coverage = pd .concat (
115+ [climate .cloud_coverage , climate .cloud_coverage .iloc [[- 1 ]]]
116+ )
117+
118+ region = Region (
119+ 2024 ,
120+ climate = climate ,
121+ houses = example_houses ,
122+ holidays = example_holidays ,
123+ resample_rule = "1h" ,
124+ )
125+ load_curves = region .get_load_curve_houses ()
126+ assert len (load_curves ) == 8784 # 366 days * 24 hours
117127
118128 def test_temperature_limits (self , example_houses ):
119129 """Test custom temperature limits."""
0 commit comments