10000 Replace freq '1M' with '1MS' by AdamRJensen · Pull Request #2266 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

Replace freq '1M' with '1MS' #2266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Prev Previous commit
Next Next commit
Modify turbidity tess
  • Loading branch information
AdamRJensen committed Oct 17, 2024
commit 2228d8bd4698fbd80354c36d124f2a69bfc8a800
16 changes: 10 additions & 6 deletions pvlib/tests/test_clearsky.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,9 @@ def test_lookup_linke_turbidity_nointerp():


def test_lookup_linke_turbidity_months():
times = pd.date_range(start='2014-04-01', end='2014-07-01',
freq='1MS', tz='America/Phoenix')
times = pd.date_range(start='2014-05-01', end='2014-07-01',
freq='1MS', tz='America/Phoenix',
) - pd.Timedelta(days=1)
expected = pd.Series(
np.array([2.89918032787, 2.97540983607, 3.19672131148]), index=times
)
Expand All @@ -234,8 +235,9 @@ def test_lookup_linke_turbidity_months():


def test_lookup_linke_turbidity_months_leapyear():
times = pd.date_range(start='2016-04-01', end='2016-07-01',
freq='1MS', tz='America/Phoenix')
times = pd.date_range(start='2016-05-01', end='2016-07-01',
freq='1MS', tz='America/Phoenix',
) - pd.Timedelta(days=1)
expected = pd.Series(
np.array([2.89918032787, 2.97540983607, 3.19672131148]), index=times
)
Expand All @@ -245,14 +247,16 @@ def test_lookup_linke_turbidity_months_leapyear():

def test_lookup_linke_turbidity_nointerp_months():
times = pd.date_range(start='2014-04-10', end='2014-07-10',
freq='1MS', tz='America/Phoenix')
freq='1MS', tz='America/Phoenix',
) - pd.Timedelta(days=1)
expected = pd.Series(np.array([2.85, 2.95, 3.]), index=times)
out = clearsky.lookup_linke_turbidity(times, 32.125, -110.875,
interp_turbidity=False)
assert_series_equal(expected, out)
# changing the dates shouldn't matter if interp=False
times = pd.date_range(start='2014-04-05', end='2014-07-05',
freq='1MS', tz='America/Phoenix')
freq='1MS', tz='America/Phoenix',
) - pd.Timedelta(days=1)
out = clearsky.lookup_linke_turbidity(times, 32.125, -110.875,
interp_turbidity=False)
assert_series_equal(expected, out)
Expand Down
Loading
0