Skip to content

Commit 30a4513

Browse files
committed
Merge branch 'cross-axis-whatever-name-consistent-name' of https://github.com/echedey-ls/pvlib-python into cross-axis-whatever-name-consistent-name
2 parents 3ed6172 + 6de2087 commit 30a4513

File tree

5 files changed

+25
-18
lines changed

5 files changed

+25
-18
lines changed

pvlib/iotools/acis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@ def get_acis_station_data(station, start, end, trace_val=0.001,
413413
'climdiv,valid_daterange,tzo,network')
414414
}
415415
df, metadata = _get_acis(start, end, params, map_variables, url, **kwargs)
416-
df = df.replace("M", np.nan)
417-
df = df.replace("T", trace_val)
416+
df = df.mask(df == 'M', np.nan)
417+
df = df.mask(df == 'T', trace_val)
418418
df = df.astype(float)
419419
return df, metadata
420420

pvlib/temperature.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -456,14 +456,14 @@ def faiman(poa_global, temp_air, wind_speed=1.0, u0=25.0, u1=6.84):
456456
speed at module height used to determine NOCT. [m/s]
457457
458458
u0 : numeric, default 25.0
459-
Combined heat loss factor coefficient. The default value is one
460-
determined by Faiman for 7 silicon modules
459+
Combined heat loss factor coefficient. The default value is for module
460+
temperature determined by Faiman for 7 silicon modules
461461
in the Negev desert on an open rack at 30.9° tilt.
462462
:math:`\left[\frac{\text{W}/{\text{m}^2}}{\text{C}}\right]`
463463
464464
u1 : numeric, default 6.84
465-
Combined heat loss factor influenced by wind. The default value is one
466-
determined by Faiman for 7 silicon modules
465+
Combined heat loss factor influenced by wind. The default value is
466+
for module temperature determined by Faiman for 7 silicon modules
467467
in the Negev desert on an open rack at 30.9° tilt.
468468
:math:`\left[ \frac{\text{W}/\text{m}^2}{\text{C}\ \left( \text{m/s} \right)} \right]`
469469
@@ -539,14 +539,14 @@ def faiman_rad(poa_global, temp_air, wind_speed=1.0, ir_down=None,
539539
surface. [W/m^2]
540540
541541
u0 : numeric, default 25.0
542-
Combined heat loss factor coefficient. The default value is one
543-
determined by Faiman for 7 silicon modules
542+
Combined heat loss factor coefficient. The default value is for module
543+
temperature determined by Faiman for 7 silicon modules
544544
in the Negev desert on an open rack at 30.9° tilt.
545545
:math:`\left[\frac{\text{W}/{\text{m}^2}}{\text{C}}\right]`
546546
547547
u1 : numeric, default 6.84
548-
Combined heat loss factor influenced by wind. The default value is one
549-
determined by Faiman for 7 silicon modules
548+
Combined heat loss factor influenced by wind. The default value is for
549+
module temperature determined by Faiman for 7 silicon modules
550550
in the Negev desert on an open rack at 30.9° tilt.
551551
:math:`\left[ \frac{\text{W}/\text{m}^2}{\text{C}\ \left( \text{m/s} \right)} \right]`
552552
@@ -713,8 +713,7 @@ def ross(poa_global, temp_air, noct=None, k=None):
713713
return temp_air + k * poa_global
714714

715715

716-
def _fuentes_hconv(tave, windmod, tinoct, temp_delta, xlen, tilt,
717-
check_reynold):
716+
def _fuentes_hconv(tave, windmod, temp_delta, xlen, tilt, check_reynold):
718717
# Calculate the convective coefficient as in Fuentes 1987 -- a mixture of
719718
# free, laminar, and turbulent convection.
720719
densair = 0.003484 * 101325.0 / tave # density
@@ -836,7 +835,7 @@ def fuentes(poa_global, temp_air, wind_speed, noct_installed, module_height=5,
836835
# convective coefficient of top surface of module at NOCT
837836
windmod = 1.0
838837
tave = (tinoct + 293.15) / 2
839-
hconv = _fuentes_hconv(tave, windmod, tinoct, tinoct - 293.15, xlen,
838+
hconv = _fuentes_hconv(tave, windmod, tinoct - 293.15, xlen,
840839
surface_tilt, False)
841840

842841
# determine the ground temperature ratio and the ratio of the total
@@ -896,7 +895,7 @@ def fuentes(poa_global, temp_air, wind_speed, noct_installed, module_height=5,
896895
for j in range(10):
897896
# overall convective coefficient
898897
tave = (tmod + tamb) / 2
899-
hconv = convrat * _fuentes_hconv(tave, windmod, tinoct,
898+
hconv = convrat * _fuentes_hconv(tave, windmod,
900899
abs(tmod-tamb), xlen,
901900
surface_tilt, True)
902901
# sky radiation coefficient (Equation 3)

tests/iotools/test_meteonorm.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@ def test_get_meteonorm_training(
124124

125125
assert meta == expected_meta
126126
pd.testing.assert_index_equal(data.index, expected_meteonorm_index)
127-
pd.testing.assert_frame_equal(data.iloc[:12], expected_meteonorm_data)
127+
# meteonorm API only guarantees similar, not identical, results between
128+
# calls. so we allow a small amount of variation with atol.
129+
pd.testing.assert_frame_equal(data.iloc[:12], expected_meteonorm_data,
130+
check_exact=False, atol=1)
128131

129132

130133
@pytest.mark.remote_data
@@ -304,4 +307,7 @@ def test_get_meteonorm_tmy(
304307
map_variables=False,
305308
url=demo_url)
306309
assert meta == expected_meteonorm_tmy_meta
307-
pd.testing.assert_frame_equal(data.iloc[:12], expected_meteonorm_tmy_data)
310+
# meteonorm API only guarantees similar, not identical, results between
311+
# calls. so we allow a small amount of variation with atol.
312+
pd.testing.assert_frame_equal(data.iloc[:12], expected_meteonorm_tmy_data,
313+
check_exact=False, atol=1)

tests/iotools/test_sodapro.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121

2222
index_verbose = pd.date_range('2020-06-01 12', periods=4, freq='1min',
2323
tz='UTC')
24-
index_monthly = pd.date_range('2020-01-01', periods=4, freq='1M')
24+
index_monthly = pd.to_datetime(['2020-01-31', '2020-02-29', '2020-03-31',
25+
'2020-04-30'])
2526

2627

2728
dtypes_mcclear_verbose = [

tests/iotools/test_solargis.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ def test_get_solargis_utc_start_timestamp(hourly_index_start_utc):
6565
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
6666
def test_get_solargis_http_error():
6767
# Test if HTTPError is raised if date outside range is specified
68-
with pytest.raises(requests.HTTPError, match="data coverage"):
68+
match = r"request fromDate .* is before the available start date"
69+
with pytest.raises(requests.HTTPError, match=match):
6970
_, _ = pvlib.iotools.get_solargis(
7071
latitude=48.61259, longitude=20.827079,
7172
start='1920-01-01', end='1920-01-01', # date outside range

0 commit comments

Comments
 (0)