8000 Replace `pvfactors` with `solarfactors` (#1797) · Mohitajm/pvlib-python@c063992 · GitHub
[go: up one dir, main page]

Skip to content

Commit c063992

Browse files
authored
Replace pvfactors with solarfactors (pvlib#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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 7 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 16 additions & 3 deletions
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

0 commit comments

Comments
 (0)
0