Skip to content

Commit c063992

Browse files
authored
Replace pvfactors with solarfactors (#1797)
* try out solarfactors * use solarfactosr in conda env files too * docs and whatsnew * More documentation * reword for clarity; add a bit of "why"
1 parent 6bf9e07 commit c063992

15 files changed

+98
-47
lines changed

ci/requirements-py3.10.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ dependencies:
2525
- statsmodels
2626
- pip:
2727
- nrel-pysam>=2.0
28-
- pvfactors==1.5.2
28+
- solarfactors

ci/requirements-py3.11.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ dependencies:
2525
- statsmodels
2626
- pip:
2727
- nrel-pysam>=2.0
28-
- pvfactors==1.5.2
28+
- solarfactors

ci/requirements-py3.7.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ dependencies:
2525
- statsmodels
2626
- pip:
2727
- nrel-pysam>=2.0
28-
- pvfactors==1.5.2
28+
- solarfactors

ci/requirements-py3.8.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ dependencies:
2525
- statsmodels
2626
- pip:
2727
- nrel-pysam>=2.0
28-
- pvfactors==1.5.2
28+
- solarfactors

ci/requirements-py3.9.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ dependencies:
2525
- statsmodels
2626
- pip:
2727
- nrel-pysam>=2.0
28-
- pvfactors==1.5.2
28+
- solarfactors

docs/examples/bifacial/plot_bifi_model_mc.py

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
#
1919
# Future versions of pvlib may make it easier to do bifacial modeling
2020
# with ``ModelChain``.
21+
#
22+
# .. attention::
23+
# To run this example, the ``solarfactors`` package (an implementation
24+
# of the pvfactors model) must be installed. It can be installed with
25+
# either ``pip install solarfactors`` or ``pip install pvlib[optional]``,
26+
# which installs all of pvlib's optional dependencies.
27+
2128

2229
import pandas as pd
2330
from pvlib import pvsystem

docs/examples/bifacial/plot_bifi_model_pvwatts.py

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
# :py:func:`pvlib.pvsystem.pvwatts_dc` with the
1111
# :py:func:`pvlib.bifacial.pvfactors.pvfactors_timeseries` function to
1212
# transpose GHI data to both front and rear Plane of Array (POA) irradiance.
13+
#
14+
# .. attention::
15+
# To run this example, the ``solarfactors`` package (an implementation
16+
# of the pvfactors model) must be installed. It can be installed with
17+
# either ``pip install solarfactors`` or ``pip install pvlib[optional]``,
18+
# which installs all of pvlib's optional dependencies.
1319

1420
import pandas as pd
1521
from pvlib import location

docs/examples/bifacial/plot_pvfactors_fixed_tilt.py

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
# fixed-tilt systems correctly.
1212
# This example shows how to model rear-side irradiance on a fixed-tilt
1313
# array using :py:func:`pvlib.bifacial.pvfactors.pvfactors_timeseries`.
14+
#
15+
# .. attention::
16+
# To run this example, the ``solarfactors`` package (an implementation
17+
# of the pvfactors model) must be installed. It can be installed with
18+
# either ``pip install solarfactors`` or ``pip install pvlib[optional]``,
19+
# which installs all of pvlib's optional dependencies.
1420

1521
import pandas as pd
1622
from pvlib import location

docs/sphinx/source/conf.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ def setup(app):
297297
'pull': ('https://github.com/pvlib/pvlib-python/pull/%s', 'GH'),
298298
'wiki': ('https://github.com/pvlib/pvlib-python/wiki/%s', 'wiki '),
299299
'doi': ('http://dx.doi.org/%s', 'DOI: '),
300-
'ghuser': ('https://github.com/%s', '@')
300+
'ghuser': ('https://github.com/%s', '@'),
301+
'discuss': ('https://github.com/pvlib/pvlib-python/discussions/%s', 'GH'),
301302
}
302303

303304
# -- Options for manual page output ---------------------------------------

docs/sphinx/source/user_guide/bifacial.rst

+16-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ surfaces.
1515
pvlib-python provides two groups of functions for estimating front and back
1616
irradiance:
1717

18-
1. a wrapper for convenient use of the pvfactors package:
18+
1. a wrapper for convenient use of the pvfactors model:
1919
:py:func:`~pvlib.bifacial.pvfactors.pvfactors_timeseries`
2020

2121
2. the infinite sheds bifacial model:
@@ -26,12 +26,25 @@ irradiance:
2626
pvfactors
2727
---------
2828

29-
The `pvfactors <https://sunpower.github.io/pvfactors/>`_ package calculates
29+
The pvfactors model calculates
3030
incident irradiance on the front and back surfaces of an array. pvfactors uses
3131
a 2D geometry which assumes that the array is made up of long, regular rows.
3232
Irradiance is calculated in the middle of a row; end-of-row effects are not
3333
included. pvfactors can model arrays in fixed racking or on single-axis
34-
trackers.
34+
trackers with a user-configurable number of rows.
35+
36+
Prior to pvlib version 0.10.1, pvlib used the original SunPower implementation
37+
of the model via the `pvfactors <https://github.com/sunpower/pvfactors>`_
38+
package. Starting in version 0.10.1, pvlib instead uses
39+
`solarfactors <https://github.com/pvlib/solarfactors>`_, a drop-in
40+
replacement implementation maintained by the pvlib community.
41+
This switch was made when the original ``pvfactors`` package became
42+
difficult to install in modern python environments.
43+
``solarfactors`` implements the same model as ``pvfactors`` and is kept
44+
up to date and working over time. Note that "solarfactors" is only the name
45+
on PyPI (meaning it is installed via ``pip install solarfactors``);
46+
after installation, Python code still accesses it as "pvfactors"
47+
(e.g. ``import pvfactors``).
3548

3649

3750
Infinite Sheds

docs/sphinx/source/whatsnew.rst

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ What's New
66

77
These are new features and improvements of note in each release.
88

9+
.. include:: whatsnew/v0.10.1.rst
910
.. include:: whatsnew/v0.10.0.rst
1011
.. include:: whatsnew/v0.9.5.rst
1112
.. include:: whatsnew/v0.9.4.rst
+8-30
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,12 @@
11
.. _whatsnew_01010:
22

33

4-
v0.10.1 (Anticipated September, 2023)
5-
-------------------------------------
6-
7-
8-
Deprecations
9-
~~~~~~~~~~~~
10-
11-
12-
Enhancements
13-
~~~~~~~~~~~~
14-
15-
16-
Bug fixes
17-
~~~~~~~~~
18-
19-
20-
Testing
21-
~~~~~~~
22-
23-
24-
Documentation
25-
~~~~~~~~~~~~~
26-
27-
28-
Requirements
29-
~~~~~~~~~~~~
30-
31-
32-
Contributors
33-
~~~~~~~~~~~~
4+
v0.10.1 (July 3, 2023)
5+
----------------------
6+
7+
To resolve an installation issue with ``pvfactors`` and ``shapely``,
8+
this release drops the optional ``pvfactors`` dependency and replaces
9+
it with ``solarfactors``, a fork of ``pvfactors`` maintained by the
10+
pvlib community. This change should not affect any user code.
11+
(:issue:`1796`, :pull:`1797`, :discuss:`1657`)
3412

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
.. _whatsnew_01020:
2+
3+
4+
v0.10.2 (Anticipated September, 2023)
5+
-------------------------------------
6+
7+
8+
Deprecations
9+
~~~~~~~~~~~~
10+
11+
12+
Enhancements
13+
~~~~~~~~~~~~
14+
15+
16+
Bug fixes
17+
~~~~~~~~~
18+
19+
20+
Testing
21+
~~~~~~~
22+
23+
24+
Documentation
25+
~~~~~~~~~~~~~
26+
27+
28+
Requirements
29+
~~~~~~~~~~~~
30+
31+
32+
Contributors
33+
~~~~~~~~~~~~
34+

pvlib/bifacial/pvfactors.py

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
The ``bifacial.pvfactors`` module contains functions for modeling back surface
3-
plane-of-array irradiance using the pvfactors package.
3+
plane-of-array irradiance using an external implementaton of the pvfactors
4+
model (either ``solarfactors`` or the original ``pvfactors``).
45
"""
56

67
import pandas as pd
@@ -15,11 +16,15 @@ def pvfactors_timeseries(
1516
horizon_band_angle=15.):
1617
"""
1718
Calculate front and back surface plane-of-array irradiance on
18-
a fixed tilt or single-axis tracker PV array configuration, and using
19-
the open-source "pvfactors" package. pvfactors implements the model
20-
described in [1]_.
21-
Please refer to pvfactors online documentation for more details:
22-
https://sunpower.github.io/pvfactors/
19+
a fixed tilt or single-axis tracker PV array configuration using
20+
the pvfactors model.
21+
22+
The pvfactors bifacial irradiance model is described in [1]_.
23+
24+
.. versionchanged:: 0.10.1
25+
It is now recommended to install the ``solarfactors`` package
26+
(``pip install solarfactors``) instead of ``pvfactors`` for this
27+
function. For more information, see :ref:`bifacial`.
2328
2429
Parameters
2530
----------

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
'pytest-remotedata']
4848
EXTRAS_REQUIRE = {
4949
'optional': ['cython', 'ephem', 'nrel-pysam', 'numba',
50-
'pvfactors', 'statsmodels'],
50+
'solarfactors', 'statsmodels'],
5151
'doc': ['ipython', 'matplotlib', 'sphinx == 4.5.0',
5252
'pydata-sphinx-theme == 0.8.1', 'sphinx-gallery',
5353
'docutils == 0.15.2', 'pillow',
54-
'sphinx-toggleprompt >= 0.0.5', 'pvfactors'],
54+
'sphinx-toggleprompt >= 0.0.5', 'solarfactors'],
5555
'test': TESTS_REQUIRE
5656
}
5757
EXTRAS_REQUIRE['all'] = sorted(set(sum(EXTRAS_REQUIRE.values(), [])))

0 commit comments

Comments
 (0)