Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JOSS-review: comparison to other tools #1912

Merged
merged 15 commits into from
Nov 29, 2023
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
4 changes: 2 additions & 2 deletions benchmarks/benchmarks/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pandas as pd
import pvlib
from pkg_resources import parse_version
from packaging.version import Version


def set_solar_position(obj):
Expand Down Expand Up @@ -37,7 +37,7 @@ def time_location_get_clearsky(self):
class Location_0_6_1:

def setup(self):
if parse_version(pvlib.__version__) < parse_version('0.6.1'):
if Version(pvlib.__version__) < Version('0.6.1'):
raise NotImplementedError

set_solar_position(self)
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/benchmarks/solarposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import pvlib
from pvlib import solarposition

from pkg_resources import parse_version
from packaging.version import Version


if parse_version(pvlib.__version__) >= parse_version('0.6.1'):
if Version(pvlib.__version__) >= Version('0.6.1'):
sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa
else:
sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/benchmarks/solarposition_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Try to keep relevant sections in sync with benchmarks/solarposition.py
"""

from pkg_resources import parse_version
from packaging.version import Version
import pandas as pd

import os
Expand All @@ -18,7 +18,7 @@
from pvlib import solarposition # NOQA: E402


if parse_version(pvlib.__version__) >= parse_version('0.6.1'):
if Version(pvlib.__version__) >= Version('0.6.1'):
sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa
else:
sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/benchmarks/temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pandas as pd
import pvlib
from pkg_resources import parse_version
from packaging.version import Version
from functools import partial


Expand All @@ -20,7 +20,7 @@ class SAPM:

def setup(self):
set_weather_data(self)
if parse_version(pvlib.__version__) >= parse_version('0.7.0'):
if Version(pvlib.__version__) >= Version('0.7.0'):
kwargs = pvlib.temperature.TEMPERATURE_MODEL_PARAMETERS['sapm']
kwargs = kwargs['open_rack_glass_glass']
self.sapm_cell_wrapper = partial(pvlib.temperature.sapm_cell,
Expand All @@ -41,7 +41,7 @@ def time_sapm_cell(self):
class Fuentes:

def setup(self):
if parse_version(pvlib.__version__) < parse_version('0.8.0'):
if Version(pvlib.__version__) < Version('0.8.0'):
raise NotImplementedError

set_weather_data(self)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
# `NSRDB`_ user manuals.
#
# The Erbs and Boland models are correlations only based on the clearness index
# kt, which is the ratio of GHI to the the horizontal component of the
# kt, which is the ratio of GHI to the horizontal component of the
# extra-terrestrial irradiance. At low sun elevation (zenith near 90 degrees),
# especially near sunset, kt can explode because the denominator
# (extra-terrestrial irradiance) approaches zero. In pvlib this behavior is
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/iv-modeling/plot_singlediode.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
plt.xlabel('Module voltage [V]')
plt.ylabel('Module current [A]')
plt.title(parameters['Name'])
plt.show()
plt.gcf().set_tight_layout(True)


Expand All @@ -136,6 +135,7 @@ def draw_arrow(ax, label, x0, y0, rotation, size, direction):
ax = plt.gca()
draw_arrow(ax, 'Irradiance', 20, 2.5, 90, 15, 'r')
draw_arrow(ax, 'Temperature', 35, 1, 0, 15, 'l')
plt.show()

print(pd.DataFrame({
'i_sc': curve_info['i_sc'],
Expand Down
1 change: 1 addition & 0 deletions docs/sphinx/source/reference/irradiance/transposition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Transposition models
irradiance.get_sky_diffuse
irradiance.isotropic
irradiance.perez
irradiance.perez_driesse
irradiance.haydavies
irradiance.klucher
irradiance.reindl
Expand Down
15 changes: 12 additions & 3 deletions docs/sphinx/source/whatsnew/v0.10.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,29 @@ v0.10.3 (Anticipated December, 2023)

Enhancements
~~~~~~~~~~~~

* Added the continuous Perez-Driesse transposition model.
:py:func:`pvlib.irradiance.perez_driesse` (:issue:`1841`, :pull:`1876`)
* :py:func:`pvlib.bifacial.infinite_sheds.get_irradiance` and
:py:func:`pvlib.bifacial.infinite_sheds.get_irradiance_poa` now include
shaded fraction in returned variables. (:pull:`1871`)

Bug fixes
~~~~~~~~~


Testing
~~~~~~~
* Replace use of deprecated ``pkg_resources``. (:issue:`1881`, :pull:`1882`)


Documentation
~~~~~~~~~~~~~

* Fixed a plotting issue in the IV curve gallery example (:pull:`1895`)

Contributors
~~~~~~~~~~~~

* Arjan Keeman (:ghuser:`akeeman`)
* Miguel Sánchez de León Peque (:ghuser:`Peque`)
* Will Hobbs (:ghuser:`williamhobbs`)
* Anton Driesse (:ghuser:`adriesse`)
* :ghuser:`matsuobasho`
73 changes: 72 additions & 1 deletion paper/paper.bib
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,83 @@ @article{pvlibjoss2018

@inproceedings{Holmgren2018,
Author = {William F. Holmgren and Clifford W. Hansen and Joshua S. Stein and Mark A. Mikofski},
Booktitle = {IEEE 45th Photovoltaic Specialists Conference},
Booktitle = {45th IEEE Photovoltaic Specialists Conference},
Title = {Review of open source tools for PV modeling},
Year = {2018},
doi = {10.5281/zenodo.1401378}
}

@inproceedings{Andrews2014,
doi = {10.1109/pvsc.2014.6925501},
url = {https://doi.org/10.1109/pvsc.2014.6925501},
year = {2014},
month = jun,
publisher = {{IEEE}},
author = {Robert W. Andrews and Joshua S. Stein and Clifford Hansen and Daniel Riley},
title = {Introduction to the open source {PV} {LIB} for python Photovoltaic system modelling package},
booktitle = {40th IEEE Photovoltaic Specialists Conference}
}

@inproceedings{Mermoud1994,
title = {{PVSYST}: a user-friendly software for {PV}-systems simulation},
booktitle = {Twelfth European Photovoltaic Solar Energy Conference},
year = {1994},
author = {André Mermoud}
}

@inproceedings{Mikofski2018,
title = {Accurate Performance Predictions of Large PV Systems with Shading using Submodule Mismatch Calculation},
url = {http://dx.doi.org/10.1109/PVSC.2018.8547323},
DOI = {10.1109/pvsc.2018.8547323},
booktitle = {7th World Conference on Photovoltaic Energy Conversion (WCPEC)},
publisher = {IEEE},
author = {Mikofski, Mark A. and Lynn, Matthew and Byrne, James and Hamer, Mike and Neubert, Anja and Newmiller, Jeff},
year = {2018},
month = jun
}

@inproceedings{Passow2017,
title = {PlantPredict: Solar Performance Modeling Made Simple},
url = {http://dx.doi.org/10.1109/PVSC.2017.8366450},
DOI = {10.1109/pvsc.2017.8366450},
booktitle = {44th IEEE Photovoltaic Specialists Conference (PVSC)},
publisher = {IEEE},
author = {Passow, Kendra and Ngan, Lauren and Rich, Geoffrey and Lee, Mitch and Kaplan, Stephen},
year = {2017},
month = jun
}

@techreport{Gilman2018,
title = {SAM Photovoltaic Model Technical Reference 2016 Update},
url = {http://dx.doi.org/10.2172/1429291},
DOI = {10.2172/1429291},
institution = {Office of Scientific and Technical Information (OSTI)},
author = {Gilman, Paul and DiOrio, Nicholas A. and Freeman, Janine M. and Janzou, Steven and Dobos, Aron and Ryberg, David},
year = {2018},
month = mar
}

@misc{pysam,
doi = {10.11578/DC.20190903.1},
url = {https://www.osti.gov/doecode/biblio/29023},
author = {Gilman, Paul and Janzou, Steven and Guittet, Darice and Freeman, Janine and DiOrio, Nicholas and Blair, Nathan and Boyd, Matthew and Neises, Ty and Wagner, Michael},
language = {en},
title = {PySAM (Python Wrapper for System Advisor Model "SAM") [SWR-19-57]},
publisher = {National Renewable Energy Laboratory (NREL), Golden, CO (United States)},
year = {2019}
}

@inproceedings{Pai2016,
title = {Introducing CASSYS: An open-source software for simulation of grid-connected photovoltaic systems},
url = {http://dx.doi.org/10.1109/PVSC.2016.7749839},
DOI = {10.1109/pvsc.2016.7749839},
booktitle = {43rd IEEE Photovoltaic Specialists Conference},
publisher = {IEEE},
author = {Pai, Abhijeet and Thevenard, Didier},
year = {2016},
month = jun
}

@techreport{Augspurger2023,
author = {Tobias Augspurger and Eirini Malliaraki and Josh Hopkins and Dan Brown},
title = {The Open Source Sustainability Ecosystem},
Expand Down
27 changes: 21 additions & 6 deletions paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,41 @@ of the global solar energy industry demands correspondingly more
capable models. Per the United States Department of Energy,
"the importance of accurate modeling is hard to overstate" [@seto2022].

Compared with other PV modeling tools, pvlib python stands out in several
Compared with other modern PV system modeling tools, pvlib python stands out in several
key aspects. One is its toolbox design, providing the user a
level of flexibility and customization beyond that of other tools. Rather than organizing
the user interface around pre-built modeling workflows, pvlib python
makes the individual "building blocks" of PV performance models accessible to
the user interface around pre-built modeling workflows as in other PV system
modeling tools (e.g. SAM [@Gilman2018], PVsyst [@Mermoud1994], SolarFarmer [@Mikofski2018],
PlantPredict [@Passow2017], and CASSYS [@Pai2016], to name a few software tools with
comparable breadth of PV system modeling capability), pvlib python
makes the individual "building blocks" of PV system performance models accessible to
the user. This allows the user to assemble their own model workflows, including
the ability of incorporating custom modeling steps. This flexibility
is essential for applications in both academia and industry.
is essential for applications in both academia and industry. To our knowledge,
the only other PV system modeling software with such a toolbox design is the
original MATLAB version of pvlib [@Andrews2014]. pvlib python began as
a translation of that code base and has since surpassed it in terms of
capability, community uptake, and development attention.

Another key aspect of pvlib python is that it is used via
a general-purpose programming language (Python), which
allows pvlib python functions to be combined with capabilities in other Python packages,
such as database query, data manipulation, numerical optimization,
plotting, and reporting packages.
plotting, and reporting packages. In contrast, most other PV system modeling
tools are used via some form of GUI. Some of these other tools are also accessible
from Python via web APIs or wrapper libraries (e.g. [@pysam]), but these
"black box" interfaces offer only limited ability to combine the PV models
with functionality from other Python packages.

A final key aspect of pvlib python is its open peer review approach and
foundation on published scientific research, allowing it to be developed by
a decentralized and diverse community of PV researchers and practitioners
without compromising its focus on transparent and reliable model
implementations.
implementations. This is in contrast to the inherent opaqueness of closed-source
commercial software, which prevents users from inspecting the source code
to ensure a model implementation's validity or traceability to a reference.
It is also in contrast to other open-source PV projects, where code review
and contributions typically come from a single institution.

These key aspects, along with sustained contributions from a passionate and
committed community, have led to pvlib python's widespread adoption across the PV
Expand Down
12 changes: 11 additions & 1 deletion pvlib/bifacial/infinite_sheds.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ def get_irradiance_poa(surface_tilt, surface_azimuth, solar_zenith,
[W/m^2]
- ``poa_ground_diffuse`` : total ground-reflected diffuse irradiance on the
plane of array. [W/m^2]
- ``shaded_fraction`` : fraction of row slant height from the bottom that
is shaded from direct irradiance by adjacent rows. [unitless]

References
----------
Expand Down Expand Up @@ -369,7 +371,7 @@ def get_irradiance_poa(surface_tilt, surface_azimuth, solar_zenith,
output = {
'poa_global': poa_global, 'poa_direct': poa_direct,
'poa_diffuse': poa_diffuse, 'poa_ground_diffuse': poa_gnd_pv,
'poa_sky_diffuse': poa_sky_pv}
'poa_sky_diffuse': poa_sky_pv, 'shaded_fraction': f_x}
if isinstance(poa_global, pd.Series):
output = pd.DataFrame(output)
return output
Expand Down Expand Up @@ -502,6 +504,9 @@ def get_irradiance(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth,
cells from the front surface. [W/m^2]
- ``poa_front_ground_diffuse`` : ground-reflected diffuse irradiance
reaching the module cells from the front surface. [W/m^2]
- ``shaded_fraction_front`` : fraction of row slant height from the bottom
that is shaded from direct irradiance on the front surface by adjacent
rows. [unitless]
- ``poa_back_direct`` : direct irradiance reaching the module cells from
the back surface. [W/m^2]
- ``poa_back_diffuse`` : total diffuse irradiance reaching the module
Expand All @@ -510,6 +515,9 @@ def get_irradiance(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth,
cells from the back surface. [W/m^2]
- ``poa_back_ground_diffuse`` : ground-reflected diffuse irradiance
reaching the module cells from the back surface. [W/m^2]
- ``shaded_fraction_back`` : fraction of row slant height from the bottom
that is shaded from direct irradiance on the back surface by adjacent
rows. [unitless]

References
----------
Expand Down Expand Up @@ -545,13 +553,15 @@ def get_irradiance(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth,
'poa_diffuse': 'poa_front_diffuse',
'poa_sky_diffuse': 'poa_front_sky_diffuse',
'poa_ground_diffuse': 'poa_front_ground_diffuse',
'shaded_fraction': 'shaded_fraction_front',
}
colmap_back = {
'poa_global': 'poa_back',
'poa_direct': 'poa_back_direct',
'poa_diffuse': 'poa_back_diffuse',
'poa_sky_diffuse': 'poa_back_sky_diffuse',
'poa_ground_diffuse': 'poa_back_ground_diffuse',
'shaded_fraction': 'shaded_fraction_back',
}

if isinstance(ghi, pd.Series):
Expand Down
2 changes: 1 addition & 1 deletion pvlib/iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ def schlick(aoi):


def schlick_diffuse(surface_tilt):
"""
r"""
Determine the incidence angle modifiers (IAM) for diffuse sky and
ground-reflected irradiance on a tilted surface using the Schlick
incident angle model.
Expand Down
Loading
Loading