|
1 | 1 | import os |
2 | 2 | import datetime as dt |
3 | 3 | import warnings |
| 4 | +import pytest |
4 | 5 |
|
5 | 6 | try: |
6 | 7 | from importlib import reload |
@@ -423,3 +424,28 @@ def test_solar_position_multithreaded(self): |
423 | 424 | nresult, self.spa.solar_position( |
424 | 425 | times, lat, lon, elev, pressure, temp, delta_t, |
425 | 426 | atmos_refract, numthreads=3, sst=True)[:3], 5) |
| 427 | + |
| 428 | + # Define extra test cases for issue #2077 |
| 429 | + test_cases_issue_2207 = [ |
| 430 | + ((2000, 1, 1, 12, 0, 0), 2451545.0), |
| 431 | + ((1999, 1, 1, 0, 0, 0), 2451179.5), |
| 432 | + ((1987, 1, 27, 0, 0, 0), 2446822.5), |
| 433 | + ((1987, 6, 19, 12, 0, 0), 2446966.0), |
| 434 | + ((1988, 1, 27, 0, 0, 0), 2447187.5), |
| 435 | + ((1988, 6, 19, 12, 0, 0), 2447332.0), |
| 436 | + ((1900, 1, 1, 0, 0, 0), 2415020.5), |
| 437 | + ((1600, 1, 1, 0, 0, 0), 2305447.5), |
| 438 | + ((1600, 12, 31, 0, 0, 0), 2305812.5), |
| 439 | + ((837, 4, 10, 7, 12, 0), 2026871.8), |
| 440 | + ((-123, 12, 31, 0, 0, 0), 1676496.5), |
| 441 | + ((-122, 1, 1, 0, 0, 0), 1676497.5), |
| 442 | + ((-1000, 7, 12, 12, 0, 0), 1356001.0), |
| 443 | + ((-1000, 2, 29, 0, 0, 0), 1355866.5), |
| 444 | + ((-1001, 8, 17, 21, 36, 0), 1355671.4), |
| 445 | + ((-4712, 1, 1, 12, 0, 0), 0.1), |
| 446 | + ] |
| 447 | + |
| 448 | + @pytest.mark.parametrize("inputs, expected", test_cases_issue_2207) |
| 449 | + def test_julian_day_issue_2207(inputs, expected): |
| 450 | + result = pvlib.spa.julian_day_dt(*inputs, microsecond=0) |
| 451 | + assert result == expected, f"Failed for inputs {inputs}: expected {expected}, got {result}" |
0 commit comments