Skip to content

Commit 56646a6

Browse files
committed
more delta_t array tests
1 parent 3d14954 commit 56646a6

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

pvlib/tests/test_solarposition.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def test_spa_python_numpy_physical_dst(expected_solpos, golden):
139139
assert_frame_equal(expected_solpos, ephem_data[expected_solpos.columns])
140140

141141

142-
@pytest.mark.parametrize('delta_t', [65.0, None])
142+
@pytest.mark.parametrize('delta_t', [65.0, None, np.array([65, 65])])
143143
def test_sun_rise_set_transit_spa(expected_rise_set_spa, golden, delta_t):
144144
# solution from NREL SAP web calculator
145145
south = Location(-35.0, 0.0, tz='UTC')
@@ -529,7 +529,7 @@ def test_get_solarposition_method_pyephem(expected_solpos, golden):
529529
assert_frame_equal(expected_solpos, ephem_data[expected_solpos.columns])
530530

531531

532-
@pytest.mark.parametrize('delta_t', [64.0, None])
532+
@pytest.mark.parametrize('delta_t', [64.0, None, np.array([64, 64])])
533533
def test_nrel_earthsun_distance(delta_t):
534534
times = pd.DatetimeIndex([datetime.datetime(2015, 1, 2),
535535
datetime.datetime(2015, 8, 2)]
@@ -539,11 +539,12 @@ def test_nrel_earthsun_distance(delta_t):
539539
index=times)
540540
assert_series_equal(expected, result)
541541

542-
times = datetime.datetime(2015, 1, 2)
543-
result = solarposition.nrel_earthsun_distance(times, delta_t=delta_t)
544-
expected = pd.Series(np.array([0.983289204601]),
545-
index=pd.DatetimeIndex([times, ]))
546-
assert_series_equal(expected, result)
542+
if np.size(delta_t) == 1: # skip the array delta_t
543+
times = datetime.datetime(2015, 1, 2)
544+
result = solarposition.nrel_earthsun_distance(times, delta_t=delta_t)
545+
expected = pd.Series(np.array([0.983289204601]),
546+
index=pd.DatetimeIndex([times, ]))
547+
assert_series_equal(expected, result)
547548

548549

549550
def test_equation_of_time():

0 commit comments

Comments
 (0)