Skip to content

Create inverter.py #886

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

Merged
merged 36 commits into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e9fe39c
create inverter.py, move code, add adrinverter fixture
cwhanse Feb 11, 2020
4be25ba
stickler, adjust PVSystem methods
cwhanse Feb 11, 2020
904595b
update modelchain, test fixes
cwhanse Feb 11, 2020
1769295
sticker
cwhanse Feb 11, 2020
1dd3e7b
Merge branch 'master' of https://github.com/pvlib/pvlib-python into i…
cwhanse May 21, 2020
06cb965
docstring improvements
cwhanse May 21, 2020
d13d162
more docstring work
cwhanse May 21, 2020
592d33b
lint, kludge inverter.test_deprecated_09
cwhanse May 21, 2020
1bb1567
lint, kludge test_deprecated_09 x2
cwhanse May 21, 2020
a27bbaf
Merge branch 'master' of https://github.com/pvlib/pvlib-python into i…
cwhanse Jun 10, 2020
d371713
use new conftest capability
cwhanse Jun 10, 2020
f9f8ae7
correct use of fixture
cwhanse Jun 10, 2020
f6d6f77
add test for invalid ac model string
cwhanse Jun 10, 2020
d0e811f
update whatsnew
cwhanse Jun 10, 2020
f630f05
update api.rst
cwhanse Jun 10, 2020
78a7611
extend test_ac_models to new key values
cwhanse Jun 10, 2020
4a19d67
more for whatsnew
cwhanse Jun 10, 2020
ea90bec
correct modelchain.ac_model test
cwhanse Jun 10, 2020
1eb75cd
test correction
cwhanse Jun 10, 2020
e471ec2
edits from review
cwhanse Jun 14, 2020
4759394
more edits from review
cwhanse Jun 15, 2020
7183c95
fix thedocs, error
cwhanse Jun 16, 2020
7e9532f
fix indents
cwhanse Jun 16, 2020
6dc4dae
Merge branch 'master' of https://github.com/pvlib/pvlib-python into i…
cwhanse Jun 25, 2020
c85ab82
improvements from review
cwhanse Jun 26, 2020
dd40006
more improvements from review
cwhanse Jun 26, 2020
89c3460
Merge branch 'master' of https://github.com/pvlib/pvlib-python into i…
cwhanse Jul 1, 2020
7663321
improvements from review
cwhanse Jul 6, 2020
ff13e7e
improvements from review
cwhanse Jul 6, 2020
da5dc15
Merge branch 'master' into inverter
cwhanse Jul 6, 2020
75d818b
last cleanup
cwhanse Jul 7, 2020
9a9f105
last cleanup part 2
cwhanse Jul 7, 2020
9be21e4
last cleanup part 3
cwhanse Jul 7, 2020
33cddd2
py:attribute in whatsnew
cwhanse Jul 7, 2020
1e07351
docstring improvements
cwhanse Jul 7, 2020
6ba55aa
one more
cwhanse Jul 7, 2020
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
30 changes: 20 additions & 10 deletions docs/sphinx/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,21 @@ Low-level functions for solving the single diode equation.
singlediode.bishop88_v_from_i
singlediode.bishop88_mpp

SAPM model
----------
Inverter models (DC to AC conversion)
-------------------------------------

.. autosummary::
:toctree: generated/

inverter.sandia
inverter.adr
inverter.pvwatts

Functions relevant for the SAPM model.
PV System Models
----------------

Sandia array performance model (SAPM)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. autosummary::
:toctree: generated/
Expand All @@ -277,28 +288,27 @@ Functions relevant for the SAPM model.
pvsystem.sapm_effective_irradiance
pvsystem.sapm_spectral_loss
pvsystem.sapm_aoi_loss
pvsystem.snlinverter
pvsystem.adrinverter
inverter.sandia
temperature.sapm_cell

Pvsyst model
-------------

Functions relevant for the Pvsyst model.
^^^^^^^^^^^^

.. autosummary::
:toctree: generated/

temperature.pvsyst_cell
pvsystem.calcparams_pvsyst
pvsystem.singlediode

PVWatts model
-------------
^^^^^^^^^^^^^

.. autosummary::
:toctree: generated/

pvsystem.pvwatts_dc
pvsystem.pvwatts_ac
inverter.pvwatts
pvsystem.pvwatts_losses

Functions for fitting diode models
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/source/introtutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ to accomplish our system modeling goal:
total_irrad['poa_direct'], total_irrad['poa_diffuse'],
am_abs, aoi, module)
dc = pvlib.pvsystem.sapm(effective_irradiance, tcell, module)
ac = pvlib.pvsystem.snlinverter(dc['v_mp'], dc['p_mp'], inverter)
ac = pvlib.inverter.sandia(dc['v_mp'], dc['p_mp'], inverter)
annual_energy = ac.sum()
energies[name] = annual_energy

Expand Down
18 changes: 16 additions & 2 deletions docs/sphinx/source/whatsnew/v0.8.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@
v0.8.0 (Month day, year)
-------------------------

API Changes with Deprecations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Moved functions related to inverters from ``pvsystem.py`` to ``inverter.py``.
Functions are renamed to follow a more consistent pattern, as follows (:pull:`886`):
- :py:func:`pvlib.pvsystem.snlinverter` is now :py:func:`pvlib.inverter.sandia`
- :py:func:`pvlib.pvsystem.pvwatts_ac` is now :py:func:`pvlib.inverter.pvwatts`
- :py:func:`pvlib.pvsystem.adrinverter` is now :py:func:`pvlib.inverter.adr`
* Argument ``ac_model`` for :py:class:`pvlib.modelchain.ModelChain` now accepts
``'sandia'``, ``'pvwatts'`` and ``'adr'`` for the inverter models. (:pull:`886`)

API Changes
~~~~~~~~~~~
* Removed ``run_parallel_calculations`` and ``n_workers_for_parallel_calcs``
* Removed ``run_parallel_calculations`` and ``n_workers_for_parallel_calcs``
from :py:func:`pvlib.bifacial.pvfactors_timeseries` inputs (:issue:`902`)(:pull:`934`)

Enhancements
~~~~~~~~~~~~
* Update :func:`~pvlib.bifacial.pvfactors_timeseries` to run with ``pvfactors`` v1.4.1 (:issue:`902`)(:pull:`934`)
* Add :py:func:`pvlib.iam.marion_diffuse` and
* Add :py:func:`pvlib.iam.marion_diffuse` and
:py:func:`pvlib.iam.marion_integrate` to calculate IAM values for
diffuse irradiance. (:pull:`984`)

Expand All @@ -23,6 +33,8 @@ Testing
~~~~~~~
* Decorator :py:func:`pvlib.conftest.fail_on_pvlib_version` can now be
applied to functions that require args or kwargs. (:pull:`973`)
* Test added for :py:class:`pvlib.modelchain.ModelChain` to confirm ValueError when
``ac_model`` is an invalid string. (:pull:`886`)

Documentation
~~~~~~~~~~~~~
Expand All @@ -32,6 +44,8 @@ Documentation
* Clarify units for heat loss factors in
:py:func:`pvlib.temperature.pvsyst_cell` and
:py:func:`pvlib.temperature.faiman`. (:pull:`960`)
* Corrected key names for :py:func:`pvlib.inverter.sandia`. (:issue:`976`,
:pull:`886`)
* Add a transposition gain example to the gallery. (:pull:`979`)
* Add a gallery example of calculating diffuse IAM using
:py:func:`pvlib.iam.marion_diffuse`. (:pull:`984`)
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/forecast.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8159,7 +8159,7 @@
" solar_position_method: nrel_numpy\n",
" airmass_model: kastenyoung1989\n",
" dc_model: sapm\n",
" ac_model: snlinverter\n",
" ac_model: sandia\n",
" aoi_model: sapm_aoi_loss\n",
" spectral_model: sapm_spectral_loss\n",
" temp_model: sapm_temp\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/forecast_to_power.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"import matplotlib as mpl\n",
"\n",
"# finally, we import the pvlib library\n",
"from pvlib import solarposition,irradiance,atmosphere,pvsystem\n",
"from pvlib import solarposition, irradiance, atmosphere, pvsystem, inverter\n",
"from pvlib.forecast import GFS, NAM, NDFD, RAP, HRRR"
]
},
Expand Down Expand Up @@ -876,7 +876,7 @@
}
],
"source": [
"p_ac = pvsystem.snlinverter(sapm_out.v_mp, sapm_out.p_mp, sapm_inverter)\n",
"p_ac = inverter.sandia(sapm_out.v_mp, sapm_out.p_mp, sapm_inverter)\n",
"\n",
"p_ac.plot()\n",
"plt.ylabel('AC Power (W)')\n",
Expand Down
8 changes: 4 additions & 4 deletions docs/tutorials/pvsystem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"1. [systemdef](#systemdef)\n",
"2. [Angle of Incidence Modifiers](#Angle-of-Incidence-Modifiers)\n",
"2. [Sandia Cell Temp correction](#Sandia-Cell-Temp-correction)\n",
"2. [Sandia Inverter Model](#snlinverter)\n",
"2. [Sandia Inverter Model](#Sandia-inverter-model)\n",
"2. [Sandia Array Performance Model](#SAPM)\n",
" 1. [SAPM IV curves](#SAPM-IV-curves)\n",
"2. [DeSoto Model](#desoto)\n",
Expand Down Expand Up @@ -78,7 +78,7 @@
"outputs": [],
"source": [
"import pvlib\n",
"from pvlib import pvsystem"
"from pvlib import pvsystem, inverter"
]
},
{
Expand Down Expand Up @@ -573,7 +573,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### snlinverter"
"### Sandia-inverter-model"
]
},
{
Expand Down Expand Up @@ -1356,7 +1356,7 @@
"idcs = pd.Series(np.linspace(0,11,110))\n",
"pdcs = idcs * vdcs\n",
"\n",
"pacs = pvsystem.snlinverter(vdcs, pdcs, inverters['ABB__MICRO_0_25_I_OUTD_US_208_208V__CEC_2014_'])\n",
"pacs = inverter.sandia(vdcs, pdcs, inverters['ABB__MICRO_0_25_I_OUTD_US_208_208V__CEC_2014_'])\n",
"#pacs.plot()\n",
"plt.plot(pacs, pdcs)\n",
"plt.ylabel('ac power')\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/tmy_to_power.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1184,8 +1184,8 @@
],
"source": [
"p_acs = pd.DataFrame()\n",
"p_acs['sapm'] = pvlib.pvsystem.snlinverter(sapm_out.v_mp, sapm_out.p_mp, sapm_inverter)\n",
"p_acs['sd'] = pvlib.pvsystem.snlinverter(single_diode_out.v_mp, single_diode_out.p_mp, sapm_inverter)\n",
"p_acs['sapm'] = pvlib.inverter.sandia(sapm_out.v_mp, sapm_out.p_mp, sapm_inverter)\n",
"p_acs['sd'] = pvlib.inverter.sandia(single_diode_out.v_mp, single_diode_out.p_mp, sapm_inverter)\n",
"\n",
"p_acs.plot()\n",
"plt.ylabel('AC Power (W)')"
Expand Down
Loading