Skip to content

Commit e7d80e3

Browse files
committed
Add basic warning
1 parent de2712b commit e7d80e3

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

pvlib/iotools/pvgis.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def read_pvgis_hourly(filename, pvgis_format=None, map_variables=True):
373373
return _parse_pvgis_hourly_json(src, map_variables=map_variables)
374374

375375
# CSV: use _parse_pvgis_hourly_csv()
376-
if outputformat == 'csv':
376+
elif outputformat == 'csv':
377377
try:
378378
pvgis_data = _parse_pvgis_hourly_csv(
379379
filename, map_variables=map_variables)
@@ -383,11 +383,17 @@ def read_pvgis_hourly(filename, pvgis_format=None, map_variables=True):
383383
fbuf, map_variables=map_variables)
384384
return pvgis_data
385385

386-
# raise exception if pvgis format isn't in ['csv', 'json']
387-
err_msg = (
388-
"pvgis format '{:s}' was unknown, must be either 'json' or 'csv'")\
389-
.format(outputformat)
390-
raise ValueError(err_msg)
386+
elif outputformat == 'basic':
387+
err_msg = "outputformat='basic' is no longer supported, please use outputformat='csv'" \
388+
" instead."
389+
raise ValueError(err_msg)
390+
391+
else:
392+
# raise exception if pvgis format isn't in ['csv', 'json']
393+
err_msg = (
394+
"pvgis format '{:s}' was unknown, must be either 'json' or 'csv'")\
395+
.format(outputformat)
396+
raise ValueError(err_msg)
391397

392398

393399
def _coerce_and_roll_tmy(tmy_data, tz, year):
@@ -674,6 +680,11 @@ def read_pvgis_tmy(filename, pvgis_format=None, map_variables=True):
674680
data, months_selected, inputs, meta = \
675681
_parse_pvgis_tmy_csv(fbuf)
676682

683+
elif outputformat == 'basic':
684+
err_msg = "outputformat='basic' is no longer supported, please use " \
685+
"outputformat='csv' instead."
686+
raise ValueError(err_msg)
687+
677688
else:
678689
# raise exception if pvgis format isn't in ['csv','epw','json']
679690
err_msg = (

0 commit comments

Comments
 (0)