.. _whatsnew_0600:

v0.6.0 (September 17, 2018)
---------------------------

This is a major release and contains a large number of API changes, new
features, and bug fixes. Users should carefully read the changelog below
before upgrading.

**Python 2.7 support will end on June 1, 2019**. Releases made after this
date will require Python 3. (:issue:`501`)


API Changes
~~~~~~~~~~~
* pvlib python is changing a handful of function names. In general, functions
  that can calculate a quantity using multiple algorithms now start
  with the prefix ``get_``. For example, ``relativeairmass`` can calculate
  airmass using one of many ``model`` arguments. Its name has been changed
  to :func:`~pvlib.atmosphere.get_relative_airmass`. The old function names remain in this
  release, but will emit a ``PVLibDeprecationWarning`` when called. The
  old functions will be removed in the v0.7 release. Functions composed
  of multiple words jammed together have been renamed with underscores
  separating the words (see above).
  Each change is detailed below. (:issue:`427`)
* Deprecated ``relativeairmass``; it will be removed in v0.7.
  Use the new :func:`~pvlib.atmosphere.get_relative_airmass` instead. (:issue:`427`)
* Deprecated ``absoluteairmass``; it will be removed in v0.7.
  Use the new :func:`~pvlib.atmosphere.get_absolute_airmass` instead. (:issue:`427`)
* Deprecated ``irradiance.globalinplane``; it will be removed in v0.7.
  Use the new :func:`~pvlib.irradiance.poa_components` instead. (:issue:`427`)
* Added :func:`~pvlib.irradiance.poa_components`. Function is the same as the now-deprecated
  ``irradiance.globalinplane``, but adds ``'poa_sky_diffuse'`` and
  ``'poa_ground_diffuse'`` to the output. (:issue:`427`)
* Deprecated ``irradiance.extraradiation``; it will be removed in v0.7.
  Use :func:`pvlib.irradiance.get_extra_radiation` instead. (:issue:`427`)
* Deprecated ``irradiance.grounddiffuse``; it will be removed in v0.7. Use
  :func:`~pvlib.irradiance.get_ground_diffuse` instead. (:issue:`427`)
* Added :func:`~pvlib.irradiance.get_poa_sky_diffuse`. (:issue:`427`)
* Deprecated ``irradiance.total_irrad``; it will be removed in v0.7. Use
  :func:`~pvlib.irradiance.get_total_poa_irradiance` instead. (:issue:`427`)
* Removed ``'klutcher'`` from ``get_sky_diffuse``/``total_irrad``. This misspelling was
  deprecated long ago but never removed. (:issue:`97`)
* :func:`~pvlib.pvsystem.calcparams_desoto` now requires arguments for each module model
  parameter. (:issue:`462`)
* Add losses_parameters attribute to PVSystem objects and remove the kwargs
  support from PVSystem.pvwatts_losses. Enables custom losses specification
  in ModelChain calculations. (:issue:`484`)
* removed irradiance parameter from ModelChain.run_model and ModelChain.prepare_inputs
* Add ``perez_enhancement`` keyword argument to clearsky.ineichen to control
  whether or not the "perez enhancement factor" is applied. The enhancement
  factor was always applied until now. Now it is turned off by default. The
  enhancement factor can yield unphysical results, especially for latitudes
  closer to the poles and especially in the winter months. It may yield
  improved results under other conditions. (:issue:`435`)
* Add min_cos_zenith, max_zenith keyword arguments to disc, dirint, and
  dirindex functions. (:issue:`311`, :issue:`396`)
* Method ModelChain.infer_dc_model now returns a tuple (function handle, model name string)
  instead of only the function handle (:issue:`417`)
* Add DC model methods desoto and pvsyst to ModelChain, and deprecates DC model method
  singlediode (singlediode defaults to desoto until v0.7.0) (:issue:`487`)
* Add the CEC module model in pvsystem.calcparams_cec and ModelChain.cec. The CEC model
  differs from the desoto model by using the parameter Adjust. Modules selected from
  the SAM CEC library sam-library-cec-modules-2017-6-5.csv include the Adjust parameter
  and ModelChain.infer_dc_model will now select the cec model rather than the desoto model.
  (:issue:`463`)
* The behavior of irradiance.perez(return_components=True) has changed.
  The function previously returned a tuple of total sky diffuse and
  an OrderedDict/DataFrame of components. The function now returns
  an OrderedDict/DataFrame with total sky diffuse and each component.
  The behavior for return_components=False remains unchanged. (:issue:`434`)


Enhancements
~~~~~~~~~~~~
* Add sea surface albedo in ``irradiance.py`` (:issue:`458`)
* Implement :meth:`~pvlib.modelchain.ModelChain.first_solar_spectral_loss`
  in ``modelchain.py`` (:issue:`359`)
* Clarify arguments ``Egref`` and ``dEgdT`` for
  :func:`~pvlib.pvsystem.calcparams_desoto` (:issue:`462`)
* Add pvsystem.calcparams_pvsyst to compute values for the single diode equation
  using the PVsyst v6 model (:issue:`470`)
* Extend :func:`~pvlib.pvsystem.singlediode` with an additional keyword argument
  ``method`` in ``('lambertw', 'newton', 'brentq')``, default is ``'lambertw'``,
  to select a method to solve the single diode equation for points on the IV
  curve. Selecting either ``'brentq'`` or ``'newton'`` as the method uses
  :func:`~pvlib.singlediode.bishop88` with the corresponding method.
  (:issue:`410`)
* Implement new methods ``'brentq'`` and ``'newton'`` for solving the single
  diode equation for points on the IV curve. ``'brentq'`` uses a bisection
  method (Brent, 1973) that may be slow but guarantees a solution. ``'newton'``
  uses the Newton-Raphson method and may be faster but is not guaranteed to
  converge. However, ``'newton'`` should be safe for well-behaved IV curves.
  (:issue:`408`)
* Implement :func:`~pvlib.singlediode.bishop88` for explicit calculation
  of arbitrary IV curve points using diode voltage instead of cell voltage. If
  ``method`` is either ``'newton'`` or ``'brentq'`` and ``ivcurve_pnts`` in
  :func:`~pvlib.pvsystem.singlediode` is provided, the IV curve points will be
  log spaced instead of linear.
* Implement :func:`~pvlib.singlediode.estimate_voc` to estimate open
  circuit voltage by assuming :math:`R_{sh} \to \infty` and :math:`R_s=0` as an
  upper bound in bisection method for :func:`~pvlib.pvsystem.singlediode` when
  method is either ``'newton'`` or ``'brentq'``.
* Add :func:`~pvlib.pvsystem.max_power_point` method to compute the max power
  point using the new ``'brentq'`` method.
* Add new module ``pvlib.singlediode`` with low-level functions for
  solving the single diode equation such as:
  :func:`~pvlib.singlediode.bishop88`,
  :func:`~pvlib.singlediode.estimate_voc`,
  :func:`~pvlib.singlediode.bishop88_i_from_v`,
  :func:`~pvlib.singlediode.bishop88_v_from_i`, and
  :func:`~pvlib.singlediode.bishop88_mpp`.
* Add PVSyst thin-film recombination losses for CdTe and a:Si (:issue:`163`)
* Python 3.7 officially supported. (:issue:`496`)
* Improve performance of solarposition.ephemeris. (:issue:`512`)
* Improve performance of Location.get_airmass. Most noticeable when
  solar position is supplied, time index length is less than 10000, and
  method is looped over. (:issue:`502`)
* Add irradiance.gti_dirint function. (:issue:`396`)
* Add irradiance.clearness_index function. (:issue:`396`)
* Add irradiance.clearness_index_zenith_independent function. (:issue:`396`)
* Add checking for consistency between module_parameters and dc_model. (:issue:`417`)
* Add DC model methods ``'desoto'`` and ``'pvsyst'`` to ModelChain (:issue:`487`)
* Add the CEC module model in `pvsystem.calcparams_cec` and `ModelChain.cec`. (:issue:`463`)
* Add DC model methods desoto and pvsyst to ModelChain (:issue:`487`)
* pvlib now ships with a pvlib[optional] installation option to automatically
  install packages needed to support additional pvlib features:
  ``pip install pvlib[optional]``. Additional installation options include
  `doc` (requirements for minimal documentation build), `test` (requirements
  for testing), and `all` (optional + doc + test). (:issue:`553`, :issue:`483`)
* Set default alpha to 1.14 in :func:`~pvlib.atmosphere.angstrom_aod_at_lambda` (:issue:`563`)
* tracking.singleaxis now accepts scalar and 1D-array input.


Bug fixes
~~~~~~~~~
* Unset executable bits of irradiance.py and test_irradiance.py (:issue:`460`)
* Fix failing tests due to column order on Python 3.6+ and Pandas 0.23+
  (:issue:`464`)
* ModelChain.prepare_inputs failed to pass solar_position and airmass to
  Location.get_clearsky. Fixed. (:issue:`481`)
* Add User-Agent specification to TMY3 remote requests to avoid rejection.
  (:issue:`493`)
* Fix ``pvlib.irradiance.klucher`` output is different for Pandas Series vs.
  floats and NumPy arrays. (:issue:`508`)
* Make GitHub recognize the license, add AUTHORS.md, clarify shared copyright.
  (:issue:`503`)
* Fix issue with non-zero direct irradiance contribution to Reindl, Klucher,
  and Hay-Davies diffuse sky algorithms when the sun is behind the array.
  (:issue:`526`)
* Fix issue with dividing by near-0 cos(solar_zenith) values in Reindl and
  Hay-Davies diffuse sky algorithms. (:issue:`432`)
* Fix argument order of longitude and latitude when querying weather forecasts
  by lonlat bounding box (:issue:`521`)
* Fix issue with unbounded clearness index calculation in disc. (:issue:`540`)
* Limit pvwatts_ac results to be greater than or equal to 0. (:issue:`541`)
* Fix bug in get_relative_airmass(model='youngirvine1967'). (:issue:`545`)
* Fix bug in variable names returned by forecast.py's HRRR_ESRL model.
  (:issue:`557`)
* Fixed bug in tracking.singleaxis that mistakenly assigned nan values when
  the Sun was still above the horizon. No effect on systems with axis_tilt=0.
  (:issue:`569`)
* Source distribution did not contain LICENSE file. Added LICENSE, AUTHORS.md,
  and some docs to MANIFEST. (:issue:`579`)
* Patch SPA C-files to fix timezone macro name clash with `pyconfig.h`. (:issue:`168`)


Documentation
~~~~~~~~~~~~~
* Expand testing section with guidelines for functions, PVSystem/Location
  objects, and ModelChain.
* Updated several incorrect statements in ModelChain documentation regarding
  implementation status and default values. (:issue:`480`)
* Expanded general contributing and pull request guidelines.
* Added section on single diode equation with some detail on solutions used in
  pvlib-python (:issue:`518`)
* Minor improvements and updates to installation documentation. (:issue:`531`)
* Improve LocalizedPVSystem and LocalizedSingleAxisTracker documentation.
  (:issue:`532`)
* Move the "Getting Started"/"Modeling Paradigms" section to a new
  top-level "Intro Examples" page.
* Copy pvlib documentation's "Getting support" section to README.md.
* Add PVSystem documentation page. (:issue:`514`, :issue:`319`)
* Add example of Kasten Linke Turbidity calculation, discuss broadband AOD and
  Angstrom Turbidity Model. (:issue:`302`)
* Add JOSS paper to "Citing pvlib-python" section.


Testing
~~~~~~~
* Add pytest-mock dependency
* Use pytest-mock to ensure that PVSystem and ModelChain methods call
  corresponding functions correctly. Removes implicit dependence on precise
  return values of some function/methods. (:issue:`394`)
* Additional test refactoring to limit test result dependence to a single
  function per test. (:issue:`394`)
* Use pytest-mock to ensure that ModelChain DC model is set up correctly.
* Add Python 3.7 to build matrix
* Make test_forecast.py more robust. (:issue:`293`)
* Improve test_atmosphere.py. (:issue:`158`)
* Add LGTM.com integration. (:issue:`554`)
* Add SticklerCI integration.
* Add codecov integration.


Contributors
~~~~~~~~~~~~
* Will Holmgren (:ghuser:`wholmgren`)
* Yu Cao (:ghuser:`tsaoyu`)
* Cliff Hansen (:ghuser:`cwhanse`)
* Mark Mikofski (:ghuser:`mikofski`)
* Alan Mathew (:ghuser:`alamathe1`)
* Xavier Rene-Corail (:ghuser:`xcorail`)
* Anton Driesse (:ghuser:`adriesse`)
* Mark Campanelli (:ghuser:`thunderfish24`)
* Cedric Leroy (:ghuser:`cedricleroy`)
* Jessica Forbess (:ghuser:`jforbess`)
* Jeff Newmiller (:ghuser:`jdnewmil`)
* :ghuser:`josricha`
* Marc A. Anoma (:ghuser:`anomam`)
* William C Grisaitis (:ghuser:`grisaitis`)
* Karel De Brabandere (:ghuser:`kdebrab`)
* :ghuser:`tadatoshi`