Deprecate pvlib.forecast by kandersolar · Pull Request #1426 · pvlib/pvlib-python · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/sphinx/source/reference/forecasting.rst
19 changes: 19 additions & 0 deletions docs/sphinx/source/user_guide/forecasts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@
Forecasting
***********

.. warning::

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this information could go in the whatsnew as well. Open to suggestions both for its location and its content.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's new links to here, so I think it's fine.


The ``pvlib.forecast`` module is deprecated as of version ``0.9.1``.

Because none of the current pvlib team members are able to continue
maintaining it, the functionality in ``pvlib.forecast`` is deprecated
and will be removed without replacement in a future version. If you
are interested in maintaining this functionality, please let us know.

You can fetch forecast data yourself using ``siphon`` (see the
docs below this warning) and the code from pvlib v0.9.0 as a reference:
https://github.com/pvlib/pvlib-python/blob/v0.9.0/pvlib/forecast.py

The `Solar Forecast Arbiter Core
<https://solarforecastarbiter-core.readthedocs.io/en/stable/reference-forecasts.html>`_
offers similar (and more robust) forecast processing functionality
and may be a suitable replacement for some users.


pvlib python provides a set of functions and classes that make it easy
to obtain weather forecast data and convert that data into a PV power
forecast. Users can retrieve standardized weather forecast data relevant
Expand Down
2 changes: 2 additions & 0 deletions docs/sphinx/source/whatsnew/v0.9.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Deprecations
:py:meth:`pvlib.modelchain.ModelChain.with_sapm` for alternative simplified
:py:class:`~pvlib.modelchain.ModelChain` interfaces, although note that the
inputs do not directly translate. (:pull:`1401`)
* All functionality in the ``pvlib.forecast`` module is deprecated.
For details, see :ref:`forecasts`. (:issue:`1057`, :pull:`1426`)

Enhancements
~~~~~~~~~~~~
Expand Down
15 changes: 15 additions & 0 deletions pvlib/forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,23 @@
from siphon.ncss import NCSS

import warnings
from pvlib._deprecation import deprecated


warnings.warn(
'The forecast module algorithms and features are highly experimental. '
'The API may change, the functionality may be consolidated into an io '
'module, or the module may be separated into its own package.')

_forecast_deprecated = deprecated(
since='0.9.1',
removal='a future release',
addendum='For details, see https://pvlib-python.readthedocs.io/en/stable/user_guide/forecasts.html' # noqa: E501

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL is currently 404 but should work after 0.9.1 is released.

)

# don't decorate the base class to prevent the subclasses from showing
# duplicate warnings:
# @_forecast_deprecated
class ForecastModel:
"""
An object for querying and holding forecast model information for
Expand Down Expand Up @@ -684,6 +693,7 @@ def gust_to_speed(self, data, scaling=1/1.4):
return wind_speed


@_forecast_deprecated
class GFS(ForecastModel):
"""
Subclass of the ForecastModel class representing GFS
Expand Down Expand Up @@ -785,6 +795,7 @@ def process_data(self, data, cloud_cover='total_clouds', **kwargs):
return data[self.output_variables]


@_forecast_deprecated
class HRRR_ESRL(ForecastModel): # noqa: N801
"""
Subclass of the ForecastModel class representing
Expand Down Expand Up @@ -875,6 +886,7 @@ def process_data(self, data, cloud_cover='total_clouds', **kwargs):
return data[self.output_variables]


@_forecast_deprecated
class NAM(ForecastModel):
"""
Subclass of the ForecastModel class representing NAM
Expand Down Expand Up @@ -956,6 +968,7 @@ def process_data(self, data, cloud_cover='total_clouds', **kwargs):
return data[self.output_variables]


@_forecast_deprecated
class HRRR(ForecastModel):
"""
Subclass of the ForecastModel class representing HRRR
Expand Down Expand Up @@ -1044,6 +1057,7 @@ def process_data(self, data, cloud_cover='total_clouds', **kwargs):
return data[self.output_variables]


@_forecast_deprecated
class NDFD(ForecastModel):
"""
Subclass of the ForecastModel class representing NDFD forecast
Expand Down Expand Up @@ -1112,6 +1126,7 @@ def process_data(self, data, **kwargs):
return data[self.output_variables]


@_forecast_deprecated
class RAP(ForecastModel):
"""
Subclass of the ForecastModel class representing RAP forecast model.
Expand Down
44 changes: 30 additions & 14 deletions pvlib/tests/test_forecast.py