Skip to content

Commit e79a4c9

Browse files
committed
Update tests
1 parent 43afab7 commit e79a4c9

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

pvlib/iotools/pvgis.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,10 +478,10 @@ def get_pvgis_tmy(latitude, longitude, outputformat='json', usehorizon=True,
478478
dataframe by ``roll_utc_offset`` so it starts at midnight on January
479479
1st. Ignored if ``None``, otherwise will force year to ``coerce_year``.
480480
coerce_year: int, optional
481-
Use to force indices to desired year. Defaults to 1990. Specify ``None``
482-
to return the actual indicies used for the TMY. If ``coerce_year`` is
483-
``None``, but ``roll_utc_offset`` is specified, then ``coerce`` year
484-
will be set to the default.
481+
Use to force indices to desired year. Defaults to 1990. Specify
482+
``None`` to return the actual indicies used for the TMY. If
483+
``coerce_year`` is ``None``, but ``roll_utc_offset`` is specified,
484+
then ``coerce`` year will be set to the default.
485485
486486
Returns
487487
-------

tests/iotools/test_pvgis.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ def pvgis_tmy_mapped_columns():
384384
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
385385
def test_get_pvgis_tmy(expected, month_year_expected, inputs_expected,
386386
meta_expected):
387-
pvgis_data = get_pvgis_tmy(45, 8, map_variables=False)
387+
pvgis_data = get_pvgis_tmy(45, 8, map_variables=False, coerce_year=None)
388388
_compare_pvgis_tmy_json(expected, month_year_expected, inputs_expected,
389389
meta_expected, pvgis_data)
390390

@@ -428,7 +428,8 @@ def test_get_pvgis_tmy_kwargs(userhorizon_expected):
428428
_, meta = get_pvgis_tmy(45, 8, usehorizon=False, map_variables=False)
429429
assert meta['inputs']['meteo_data']['use_horizon'] is False
430430
data, _ = get_pvgis_tmy(
431-
45, 8, userhorizon=[0, 10, 20, 30, 40, 15, 25, 5], map_variables=False)
431+
45, 8, userhorizon=[0, 10, 20, 30, 40, 15, 25, 5], map_variables=False,
432+
coerce_year=None)
432433
assert np.allclose(
433434
data['G(h)'], userhorizon_expected['G(h)'].values)
434435
assert np.allclose(
@@ -491,10 +492,11 @@ def test_get_pvgis_tmy_coerce_year():
491492
@pytest.mark.remote_data
492493
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
493494
def test_get_pvgis_tmy_csv(expected, month_year_expected, inputs_expected,
494-
meta_expected, csv_meta):
495+
meta_expected, csv_meta, coerce_year=None):
495496
pvgis_data = get_pvgis_tmy(45, 8, outputformat='csv', map_variables=False)
496497
_compare_pvgis_tmy_csv(expected, month_year_expected, inputs_expected,
497-
meta_expected, csv_meta, pvgis_data)
498+
meta_expected, csv_meta, pvgis_data,
499+
coerce_year=None)
498500

499501

500502
def _compare_pvgis_tmy_csv(expected, month_year_expected, inputs_expected,
@@ -532,7 +534,8 @@ def _compare_pvgis_tmy_csv(expected, month_year_expected, inputs_expected,
532534
@pytest.mark.remote_data
533535
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
534536
def test_get_pvgis_tmy_epw(expected, epw_meta):
535-
pvgis_data = get_pvgis_tmy(45, 8, outputformat='epw', map_variables=False)
537+
pvgis_data = get_pvgis_tmy(45, 8, outputformat='epw', map_variables=False,
538+
coerce_year=None)
536539
_compare_pvgis_tmy_epw(expected, epw_meta, pvgis_data)
537540

538541

0 commit comments

Comments
 (0)