@@ -260,6 +260,21 @@ def test_fuentes(filename, inoct):
260260 assert night_difference .max () < 6
261261 assert night_difference .min () > 0
262262
263+ def test_fuentes_int_float_consistency ():
264+ """Test that int and float inputs give identical results after dtype fix."""
265+ index = pd .date_range ('2020-01-01' , periods = 3 , freq = 'h' )
266+
267+ poa_int = pd .Series ([800 , 800 , 800 ], index = index , dtype = int )
268+ poa_float = pd .Series ([800.0 , 800.0 , 800.0 ], index = index )
269+ temp_air = pd .Series ([25.0 , 25.0 , 25.0 ], index = index )
270+ wind_speed = pd .Series ([1.0 , 1.0 , 1.0 ], index = index )
271+
272+ out_int = temperature .fuentes (poa_int , temp_air , wind_speed , noct_installed = 45 )
273+ out_float = temperature .fuentes (poa_float , temp_air , wind_speed , noct_installed = 45 )
274+
275+ # Check outputs are identical within floating-point tolerance
276+ pd .testing .assert_series_equal (out_int , out_float , check_exact = False , rtol = 1e-10 )
277+
263278
264279@pytest .mark .parametrize ('tz' , [None , 'Etc/GMT+5' ])
265280def test_fuentes_timezone (tz ):
0 commit comments