Skip to content

Commit 6ee8a7c

Browse files
committed
add test with varying delta_t
1 parent 36d705d commit 6ee8a7c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pvlib/tests/test_solarposition.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,21 @@ def test_get_solarposition_deltat(delta_t, method, expected_solpos_multi,
506506
assert_frame_equal(this_expected, ephem_data[this_expected.columns])
507507

508508

509+
@pytest.mark.parametrize("method", ['nrel_numba', 'nrel_numpy'])
510+
def test_spa_array_delta_t(method):
511+
# make sure that time-varying delta_t produces different answers
512+
times = pd.to_datetime(["2019-01-01", "2019-01-01"]).tz_localize("UTC")
513+
expected = pd.Series([257.26969492, 257.2701359], index=times)
514+
with warnings.catch_warnings():
515+
# don't warn on method reload
516+
warnings.simplefilter("ignore")
517+
ephem_data = solarposition.get_solarposition(times, 40, -80,
518+
delta_t=np.array([67, 0]),
519+
method=method)
520+
521+
assert_series_equal(ephem_data['azimuth'], expected, check_names=False)
522+
523+
509524
def test_get_solarposition_no_kwargs(expected_solpos, golden):
510525
times = pd.date_range(datetime.datetime(2003, 10, 17, 13, 30, 30),
511526
periods=1, freq='D', tz=golden.tz)

0 commit comments

Comments
 (0)