diff --git a/docs/sphinx/source/reference/scaling.rst b/docs/sphinx/source/reference/scaling.rst index 75599282e2..34f1ad3a5c 100644 --- a/docs/sphinx/source/reference/scaling.rst +++ b/docs/sphinx/source/reference/scaling.rst @@ -9,3 +9,4 @@ Methods for manipulating irradiance for temporal or spatial considerations :toctree: generated/ scaling.wvm + scaling.latlon_to_xy diff --git a/docs/sphinx/source/whatsnew/v0.9.6.rst b/docs/sphinx/source/whatsnew/v0.9.6.rst index 50b11750bf..e5cb007a06 100644 --- a/docs/sphinx/source/whatsnew/v0.9.6.rst +++ b/docs/sphinx/source/whatsnew/v0.9.6.rst @@ -17,6 +17,9 @@ Breaking Changes (:pull:`1768`) * For consistency with the rest of pvlib, the ``tilt`` parameter is renamed to ``surface_tilt`` in :py:func:`pvlib.soiling.hsu`. (:issue:`1717`, :pull:`1738`) +* Several undocumented functions in :py:mod:`pvlib.iotools.midc`, + :py:mod:`pvlib.iotools.srml`, and :py:mod:`pvlib.iotools.surfrad` + are now private. (:issue:`1756`, :pull:`1769`) * The following, originally deprecated in :ref:`whatsnew_0900`, is now removed: (:pull:`1770`) - The :py:class:`pvlib.tracking.SingleAxisTracker` class diff --git a/pvlib/iotools/midc.py b/pvlib/iotools/midc.py index 063326b60c..75cc5609a7 100644 --- a/pvlib/iotools/midc.py +++ b/pvlib/iotools/midc.py @@ -102,7 +102,7 @@ } -def format_index(data): +def _format_index(data): """Create DatetimeIndex for the Dataframe localized to the timezone provided as the label of the second (time) column. @@ -126,7 +126,7 @@ def format_index(data): return data -def format_index_raw(data): +def _format_index_raw(data): """Create DatetimeIndex for the Dataframe localized to the timezone provided as the label of the third column. @@ -200,9 +200,9 @@ def read_midc(filename, variable_map={}, raw_data=False, **kwargs): """ data = pd.read_csv(filename, **kwargs) if raw_data: - data = format_index_raw(data) + data = _format_index_raw(data) else: - data = format_index(data) + data = _format_index(data) data = data.rename(columns=variable_map) return data diff --git a/pvlib/iotools/srml.py b/pvlib/iotools/srml.py index 6e7675482c..86b3e3aeb6 100644 --- a/pvlib/iotools/srml.py +++ b/pvlib/iotools/srml.py @@ -61,12 +61,12 @@ def read_srml(filename, map_variables=True): `http://solardat.uoregon.edu/ `_ """ tsv_data = pd.read_csv(filename, delimiter='\t') - data = format_index(tsv_data) + data = _format_index(tsv_data) # Drop day of year and time columns data = data[data.columns[2:]] if map_variables: - data = data.rename(columns=map_columns) + data = data.rename(columns=_map_columns) # Quality flag columns are all labeled 0 in the original data. They # appear immediately after their associated variable and are suffixed @@ -92,7 +92,7 @@ def read_srml(filename, map_variables=True): return data -def map_columns(col): +def _map_columns(col): """Map data element numbers to pvlib names. Parameters @@ -120,7 +120,7 @@ def map_columns(col): return col -def format_index(df): +def _format_index(df): """Create a datetime index from day of year, and time columns. Parameters diff --git a/pvlib/iotools/surfrad.py b/pvlib/iotools/surfrad.py index 7f4d86e46a..d3e40d86a2 100644 --- a/pvlib/iotools/surfrad.py +++ b/pvlib/iotools/surfrad.py @@ -150,7 +150,7 @@ def read_surfrad(filename, map_variables=True): header=None, names=SURFRAD_COLUMNS) file_buffer.close() - data = format_index(data) + data = _format_index(data) missing = data == -9999.9 data = data.where(~missing, np.NaN) @@ -159,7 +159,7 @@ def read_surfrad(filename, map_variables=True): return data, metadata -def format_index(data): +def _format_index(data): """Create UTC localized DatetimeIndex for the dataframe. Parameters diff --git a/pvlib/tests/iotools/test_midc.py b/pvlib/tests/iotools/test_midc.py index 1c5c38b6a2..96992babba 100644 --- a/pvlib/tests/iotools/test_midc.py +++ b/pvlib/tests/iotools/test_midc.py @@ -27,9 +27,9 @@ def test_mapping(): # '?site=UAT&begin=20181018&end=20181019') -def test_midc_format_index(): +def test_midc__format_index(): data = pd.read_csv(MIDC_TESTFILE) - data = midc.format_index(data) + data = midc._format_index(data) start = pd.Timestamp("20181014 00:00") start = start.tz_localize("MST") end = pd.Timestamp("20181014 23:59") @@ -39,16 +39,16 @@ def test_midc_format_index(): assert data.index[-1] == end -def test_midc_format_index_tz_conversion(): +def test_midc__format_index_tz_conversion(): data = pd.read_csv(MIDC_TESTFILE) data = data.rename(columns={'MST': 'PST'}) - data = midc.format_index(data) + data = midc._format_index(data) assert data.index[0].tz == pytz.timezone('Etc/GMT+8') -def test_midc_format_index_raw(): +def test_midc__format_index_raw(): data = pd.read_csv(MIDC_RAW_TESTFILE) - data = midc.format_index_raw(data) + data = midc._format_index_raw(data) start = pd.Timestamp('20181018 00:00') start = start.tz_localize('MST') end = pd.Timestamp('20181018 23:59') diff --git a/pvlib/tests/iotools/test_srml.py b/pvlib/tests/iotools/test_srml.py index 9939374ebf..8bd8c94349 100644 --- a/pvlib/tests/iotools/test_srml.py +++ b/pvlib/tests/iotools/test_srml.py @@ -70,8 +70,8 @@ def test_read_srml_dt_index(url, year, month): ('2001', '2001'), ('2017', 'dni_7') ]) -def test_map_columns(column, expected): - assert srml.map_columns(column) == expected +def test__map_columns(column, expected): + assert srml._map_columns(column) == expected @pytest.mark.remote_data