Skip to content

Commit b079fbd

Browse files
committed
Merge remote-tracking branch 'upstream/main' into irradiance_updates
2 parents 3c651e7 + 47b8df2 commit b079fbd

File tree

194 files changed

+92446
-37560
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+92446
-37560
lines changed

.github/workflows/asv_check.yml

+1-13
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,7 @@ jobs:
2626
python-version: '3.9'
2727

2828
- name: Install asv
29-
run: pip install asv==0.4.2
30-
31-
# asv 0.4.2 (and more recent versions as well) creates conda envs
32-
# using the --force option, which was removed in conda 24.3.
33-
# Since ubuntu-latest now comes with conda 24.3 pre-installed,
34-
# using the system's conda will result in error.
35-
# To prevent that, we install an older version.
36-
# TODO: remove this when we eventually upgrade our asv version.
37-
# https://github.com/airspeed-velocity/asv/issues/1396
38-
- name: Install Conda
39-
uses: conda-incubator/setup-miniconda@v3
40-
with:
41-
conda-version: 24.1.2
29+
run: pip install asv==0.6.4
4230

4331
- name: Run asv benchmarks
4432
run: |

.github/workflows/pytest-remote-data.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
strategy:
5757
fail-fast: false # don't cancel other matrix jobs when one fails
5858
matrix:
59-
python-version: [3.9, "3.10", "3.11", "3.12"]
59+
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
6060
suffix: [''] # the alternative to "-min"
6161
include:
6262
- python-version: 3.9
@@ -100,7 +100,7 @@ jobs:
100100
SOLARANYWHERE_API_KEY: ${{ secrets.SOLARANYWHERE_API_KEY }}
101101
BSRN_FTP_USERNAME: ${{ secrets.BSRN_FTP_USERNAME }}
102102
BSRN_FTP_PASSWORD: ${{ secrets.BSRN_FTP_PASSWORD }}
103-
run: pytest pvlib/tests/iotools --cov=./ --cov-report=xml --remote-data
103+
run: pytest tests/iotools --cov=./ --cov-report=xml --remote-data
104104

105105
- name: Upload coverage to Codecov
106106
if: matrix.python-version == 3.9 && matrix.suffix == ''

.github/workflows/pytest.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
fail-fast: false # don't cancel other matrix jobs when one fails
1313
matrix:
1414
os: [ubuntu-latest, macos-latest, windows-latest]
15-
python-version: [3.9, "3.10", "3.11", "3.12"]
15+
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
1616
environment-type: [conda, bare]
1717
suffix: [''] # placeholder as an alternative to "-min"
1818
include:
@@ -79,7 +79,7 @@ jobs:
7979
shell: bash -l {0} # necessary for conda env to be active
8080
run: |
8181
# ignore iotools; those tests are run in a separate workflow
82-
pytest pvlib --cov=./ --cov-report=xml --ignore=pvlib/tests/iotools
82+
pytest tests --cov=./ --cov-report=xml --ignore=tests/iotools
8383
8484
- name: Upload coverage to Codecov
8585
if: matrix.python-version == 3.9 && matrix.suffix == '' && matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda'

.gitignore

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ coverage.xml
8181

8282

8383
# Datafiles
84-
*.csv
85-
# Ignore some csv
86-
!pvlib/data/*.csv
84+
# Do not exclude data directories
85+
!pvlib/data/**
86+
!tests/data/**
8787

8888
# vi
8989
*.swp

ci/requirements-py3.12.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-
# - solarfactors # required shapely<2 isn't available for 3.12
28+
- solarfactors

ci/requirements-py3.13.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: test_env
2+
channels:
3+
- defaults
4+
- conda-forge
5+
dependencies:
6+
- coveralls
7+
- cython
8+
- ephem
9+
- h5py
10+
- numba
11+
- numpy >= 1.17.3
12+
- pandas >= 1.3.0
13+
- pip
14+
- pytest
15+
- pytest-cov
16+
- pytest-mock
17+
- requests-mock
18+
- pytest-timeout
19+
- pytest-rerunfailures
20+
- conda-forge::pytest-remotedata # version in default channel is old
21+
- python=3.13
22+
- pytz
23+
- requests
24+
- scipy >= 1.6.0
25+
- statsmodels
26+
- pip:
27+
- nrel-pysam>=2.0
28+
- solarfactors

codecov.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ flags:
1414
core:
1515
paths:
1616
- pvlib/
17+
- tests/
1718
- '!pvlib/iotools/'
18-
- '!pvlib/tests/iotools/'
19+
- '!tests/iotools/'
1920
carryforward: false
2021

2122
remote-data:
2223
paths:
2324
- pvlib/iotools/
24-
- pvlib/tests/iotools
25+
- tests/iotools
2526
carryforward: true # if not run, use coverage from previous commit
2627

2728

@@ -47,15 +48,15 @@ coverage:
4748
tests-core:
4849
target: 95%
4950
paths:
50-
- 'pvlib/tests/.*'
51-
- '!pvlib/tests/iotools/.*'
51+
- 'tests/.*'
52+
- '!tests/iotools/.*'
5253
flags:
5354
- core
5455

5556
tests-remote-data:
5657
target: 95%
5758
paths:
58-
- 'pvlib/tests/iotools/.*'
59+
- 'tests/iotools/.*'
5960
flags:
6061
- remote-data
6162

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* Overrides for sphinx-hoverxref since it does not support a native dark theme, see */
2+
/* https://github.com/readthedocs/sphinx-hoverxref/issues/231 */
3+
/* Inspired by https://github.com/pybamm-team/PyBaMM/pull/3083 */
4+
5+
/* These will ensure that the tooltip inherits the pydata-sphinx-theme colours */
6+
7+
.tooltipster-sidetip.tooltipster-shadow.tooltipster-shadow-custom .tooltipster-content {
8+
background-color: var(--pst-color-background) !important;
9+
color: var(--pst-color-text-base) !important;
10+
}

docs/sphinx/source/conf.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
intersphinx_mapping = {
6767
'python': ('https://docs.python.org/3/', None),
6868
'numpy': ('https://numpy.org/doc/stable/', None),
69-
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None),
69+
'scipy': ('https://docs.scipy.org/doc/scipy/', None),
7070
'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None),
7171
'matplotlib': ('https://matplotlib.org/stable', None),
7272
}
@@ -282,6 +282,8 @@ def setup(app):
282282
app.add_css_file("reference_format.css")
283283
# Add a warning banner at the top of the page if viewing the "latest" docs
284284
app.add_js_file("version-alert.js")
285+
# Match the color theme of tooltips to PyData Sphinx Theme light/dark mode
286+
app.add_css_file("tooltipster_color_theming.css")
285287

286288
# -- Options for LaTeX output ---------------------------------------------
287289

docs/sphinx/source/contributing/testing.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Overview
1111
Developers **must** include comprehensive tests for any additions or
1212
modifications to pvlib. New unit test code should be placed in the
1313
corresponding test module in the
14-
`pvlib/tests <https://github.com/pvlib/pvlib-python/tree/main/pvlib/tests>`_
14+
`tests <https://github.com/pvlib/pvlib-python/tree/main/tests>`_
1515
directory.
1616

1717
A pull request will automatically run the tests for you on a variety of
@@ -20,26 +20,26 @@ typically more efficient to run and debug the tests in your own local
2020
environment.
2121

2222
To run the tests locally, install the ``test`` dependencies specified in the
23-
`setup.py <https://github.com/pvlib/pvlib-python/blob/main/setup.py>`_
23+
`pyproject.toml <https://github.com/pvlib/pvlib-python/blob/main/pyproject.toml>`_
2424
file. See :ref:`installation` instructions for more information.
2525

2626
pvlib's unit tests can easily be run by executing ``pytest`` on the
27-
pvlib directory::
27+
tests directory::
2828

29-
pytest pvlib
29+
pytest tests
3030

3131
or, for a single module::
3232

33-
pytest pvlib/tests/test_clearsky.py
33+
pytest tests/test_clearsky.py
3434

3535
or, for a single test::
3636

37-
pytest pvlib/tests/test_clearsky.py::test_ineichen_nans
37+
pytest tests/test_clearsky.py::test_ineichen_nans
3838

3939
We suggest using pytest's ``--pdb`` flag to debug test failures rather
4040
than using ``print`` or ``logging`` calls. For example::
4141

42-
pytest pvlib --pdb
42+
pytest tests --pdb
4343

4444
will drop you into the
4545
`pdb debugger <https://docs.python.org/3/library/pdb.html>`_ at the
@@ -50,7 +50,7 @@ to the test suite (with rare exceptions).
5050
To include all network-dependent tests, include the ``--remote-data`` flag to
5151
your ``pytest`` call::
5252

53-
pytest pvlib --remote-data
53+
pytest tests --remote-data
5454

5555
And consider adding ``@pytest.mark.remote_data`` to any network dependent test
5656
you submit for a PR.

docs/sphinx/source/reference/airmass_atmospheric.rst

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Airmass and atmospheric models
1414
atmosphere.tdew_from_rh
1515
atmosphere.rh_from_tdew
1616
atmosphere.gueymard94_pw
17-
atmosphere.first_solar_spectral_correction
1817
atmosphere.bird_hulstrom80_aod_bb
1918
atmosphere.kasten96_lt
2019
atmosphere.angstrom_aod_at_lambda

docs/sphinx/source/reference/effects_on_pv_system_output/spectrum.rst

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Spectrum
88

99
spectrum.spectrl2
1010
spectrum.get_example_spectral_response
11-
spectrum.get_am15g
1211
spectrum.get_reference_spectra
1312
spectrum.calc_spectral_mismatch_field
1413
spectrum.spectral_factor_caballero

docs/sphinx/source/reference/iotools.rst

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ of sources and file formats relevant to solar energy modeling.
2626
iotools.read_crn
2727
iotools.read_solrad
2828
iotools.get_solrad
29+
iotools.get_nsrdb_psm4_aggregated
30+
iotools.get_nsrdb_psm4_tmy
31+
iotools.get_nsrdb_psm4_conus
32+
iotools.get_nsrdb_psm4_full_disc
33+
iotools.read_nsrdb_psm4
34+
iotools.parse_nsrdb_psm4
2935
iotools.get_psm3
3036
iotools.read_psm3
3137
iotools.parse_psm3

docs/sphinx/source/reference/modelchain.rst

-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ on the information in the associated :py:class:`~pvsystem.PVSystem` object.
112112
modelchain.ModelChain.infer_dc_model
113113
modelchain.ModelChain.infer_ac_model
114114
modelchain.ModelChain.infer_aoi_model
115-
modelchain.ModelChain.infer_spectral_model
116115
modelchain.ModelChain.infer_temperature_model
117116
modelchain.ModelChain.infer_losses_model
118117

docs/sphinx/source/reference/pv_modeling/parameters.rst

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Functions for fitting single diode models
1212
ivtools.sdm.fit_cec_sam
1313
ivtools.sdm.fit_desoto
1414
ivtools.sdm.fit_pvsyst_sandia
15+
ivtools.sdm.fit_pvsyst_iec61853_sandia_2025
1516
ivtools.sdm.fit_desoto_sandia
1617

1718
Functions for fitting the single diode equation

docs/sphinx/source/reference/pv_modeling/system_models.rst

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Sandia array performance model (SAPM)
1212

1313
pvsystem.sapm
1414
pvsystem.sapm_effective_irradiance
15-
pvsystem.sapm_spectral_loss
1615
spectrum.spectral_factor_sapm
1716
inverter.sandia
1817
temperature.sapm_cell

docs/sphinx/source/user_guide/nomenclature.rst renamed to docs/sphinx/source/user_guide/extras/nomenclature.rst

+3
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ There is a convention on consistent variable names throughout the library:
7171
ghi
7272
Global horizontal irradiance
7373

74+
ghi_clear
75+
Clearsky global horizontal irradiance [Wm⁻²]
76+
7477
ghi_extra
7578
Horizontal irradiance at top of atmosphere (extraterrestrial)
7679

docs/sphinx/source/user_guide/installation.rst renamed to docs/sphinx/source/user_guide/getting_started/installation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Follow these steps to obtain the library using git/GitHub:
133133
This button is circled in the image below. Remember the system path that
134134
you clone the library to.
135135

136-
.. image:: ../_images/clonebutton.png
136+
.. image:: ../../_images/clonebutton.png
137137

138138
Please see GitHub's
139139
`Forking Projects <https://guides.github.com/activities/forking/>`_,

docs/sphinx/source/user_guide/introtutorial.rst renamed to docs/sphinx/source/user_guide/getting_started/introtutorial.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ to accomplish our system modeling goal:
8787
longitude=longitude,
8888
altitude=altitude,
8989
temperature=weather["temp_air"],
90-
pressure=pvlib.atmosphere.alt2pres(altitude),
90+
pressure=weather["pressure"],
9191
)
9292
dni_extra = pvlib.irradiance.get_extra_radiation(weather.index)
9393
airmass = pvlib.atmosphere.get_relative_airmass(solpos['apparent_zenith'])
+26-12
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
1+
.. _user_guide:
2+
13
==========
24
User Guide
35
==========
46

7+
This user guide is an overview and explains some of the key features of pvlib.
8+
9+
.. toctree::
10+
:caption: Getting started
11+
:maxdepth: 2
12+
13+
getting_started/package_overview
14+
getting_started/installation
15+
getting_started/introtutorial
16+
17+
.. toctree::
18+
:maxdepth: 2
19+
:caption: Modeling topics
20+
21+
modeling_topics/pvsystem
22+
modeling_topics/modelchain
23+
modeling_topics/timetimezones
24+
modeling_topics/bifacial
25+
modeling_topics/clearsky
26+
modeling_topics/weather_data
27+
modeling_topics/singlediode
528

629
.. toctree::
730
:maxdepth: 2
31+
:caption: Extras
832

9-
package_overview
10-
installation
11-
introtutorial
12-
pvsystem
13-
modelchain
14-
timetimezones
15-
clearsky
16-
bifacial
17-
weather_data
18-
singlediode
19-
nomenclature
20-
faq
33+
extras/nomenclature
34+
extras/faq

docs/sphinx/source/whatsnew.rst

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

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

9-
.. include:: whatsnew/v0.11.3.rst
9+
.. include:: whatsnew/v0.12.1.rst
10+
.. include:: whatsnew/v0.12.0.rst
1011
.. include:: whatsnew/v0.11.2.rst
1112
.. include:: whatsnew/v0.11.1.rst
1213
.. include:: whatsnew/v0.11.0.rst

docs/sphinx/source/whatsnew/v0.10.0.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ Deprecations
5353
deprecated. Use :py:func:`pvlib.pvsystem.v_from_i` and
5454
:py:func:`pvlib.pvsystem.i_from_v` instead. (:issue:`1626`, :pull:`1743`)
5555
* Functions for calculating spectral modifiers have been moved to :py:mod:`pvlib.spectrum`:
56-
:py:func:`pvlib.atmosphere.first_solar_spectral_correction` is deprecated and
56+
:py:func:`!pvlib.atmosphere.first_solar_spectral_correction` is deprecated and
5757
replaced by :py:func:`~pvlib.spectrum.spectral_factor_firstsolar`, and
58-
:py:func:`pvlib.pvsystem.sapm_spectral_loss` is deprecated and replaced by
58+
:py:func:`!pvlib.pvsystem.sapm_spectral_loss` is deprecated and replaced by
5959
:py:func:`~pvlib.spectrum.spectral_factor_sapm`. (:pull:`1628`)
6060
* Removed the ``get_ecmwf_macc`` and ``read_ecmwf_macc`` iotools functions as the
6161
MACC dataset has been `removed by ECMWF <https://confluence.ecmwf.int/display/DAC/Decommissioning+of+ECMWF+Public+Datasets+Service>`_

docs/sphinx/source/whatsnew/v0.11.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Deprecations
2828
~~~~~~~~~~~~
2929
* The ``pvlib.irradiance.SURFACE_ALBEDOS`` dictionary has been moved to
3030
:py:const:`pvlib.albedo.SURFACE_ALBEDOS`. (:pull:`2095`)
31-
* Function :py:func:`pvlib.spectrum.get_am15g` has been deprecated in favor
31+
* Function :py:func:`!pvlib.spectrum.get_am15g` has been deprecated in favor
3232
of the new function :py:func:`pvlib.spectrum.get_reference_spectra`. Use
3333
``pvlib.spectrum.get_reference_spectra(standard="ASTM G173-03")["global"]``
3434
instead. (:pull:`2039`)

0 commit comments

Comments
 (0)