Skip to content

Commit

Permalink
2.0.0b0 release (#190)
Browse files Browse the repository at this point in the history
* configure travis to only deploy on one build

* prevent NaNs from summing to 0

* Update pandas requirement

min_count was added as an argument for dataframe.resample().sum() in 0.22.0

* add energy_from_power() and associated tests

* Update example notebook

Changes in step 0:
-use interpolate to resample the dataframe
-use new energy_from_power() function

* fix integer division bug for phython 2

* pep8 compliance

* Fix docstring spelling errors

* change name of series returned by energy_from_power()

* Update tests for expected series name

* Allow energy_from_power() with single argument

* change second argument of energy_from_power() to be a Timedelta (This is more appropriate and versatile than a float with implied units)

* Add series interpolation

* Add dataframe input capability to interpolate_to_index()

* Change function name and add frequency specification capability to interpolate()

* Speed up interpolate_series() (converting to integer index under the hood is faster than pandas timestamps)

* Run example with rdtools.interpolate() in step 0

* New version of energy_from_power and incorporation into normalization

* require pandas >= 0.23

* Remove warnings from interpolation when max_timedelta is inferred

* work around for pandas issue

* Add non-workaround case for tz naive series

* Change the behavior of interpolate to return NaNs where max_delta is exceeded

Old behavior was to have those times be missing from the output. The new behavior ensures that interpolate produces regular time series when a frequency is passed as target.

* address bug related to python 2 sting casting

* Add recomendation against using interpolation for downsampling

* Update notebook_requirements to address security issue in notebook version

* Update copyright line of LICENSE

* Update to use pvlib>0.6.0

* Add code from pv_soiling to soiling.py

Includes the addition of the wrapper function soiling_srr. The manual_cleanings keyword was also removed, it was not implimented in pv_soiling.

* Add confidence metric keywords and calc_info to soiling_srr()

* Avoid manipulating precip input name and change pandas syntax

* pass args to calc_monte() in soiling_srr()

* rename infer_clean to half_norm_clean

* Retain timezone in pm_frame creation

* Renormalize to median of first year (per yoy degradation).  Renorm factor is also included with calc_info

* Keep all the monte carlo soiling profiles

* import soiling_srr in __init__.py

* Add more to the soiling calc_info output

* enable modification of validity criteria in calc_result_frame

* Add validity parameters to soiling_srr()

* Clarify units of exceedance_prob in degradation_year_on_year

* add type to confidence_level in degradation_year_on_year

* clean up recenter type specification

* Update example notebook with soiling functionality

* Add axis labels to soiling plots

* Add random_seed to soiling_srr for repeatable results

* use true division in soiling.py

* require numpy greater than 1.12

Soiling code requires numpy distributions with scale 0, see numpy PR #5822 for more information

* Update notebook with note about get_clearsky() behavior change

Warnings were also removed from output, and the kernel was changed to `Python [default]`

* Replace hashes in soiling_test with more interpretable tests

* enforce column order in test_soiling_srr() test

* refactored soiling method conditionals

* Add soiling rate histogram to example

* Refactor soiling to single class

* change irradiance-weighted to insolation-weighted in soiling output

* add soiling histogram for readme

* Update readme with soiling information

* Rename the example notebook

* Add docstring to srr_analysis.__init__()

* Docstring standardization and pep8 formatting (#125)

* docstring formatting cleanup for sphinx

* add sphinx configuration files and index.rst

* document missing parameters for get_clearsky_tamb

* Add docstrings for undocumented functions.

* integrate ipython notebook examples with sphinx docs

* Update requirements.txt for Sphinx: m2r, nbsphinx, nbsphinx-link

* need to rev h5py, numpy and scipy to avoid setup install errors.

* add ipython to requirements.txt to allow inline ipython notebook examples

* rollback scipy to 1.2.2 (py27 compliant)

* custom .yml and requirements file for rtd

* point to index.html in conf.py

* test out path fixes for README.md to RST conversion

* Add Changelog to sphinx docs (#134)

* add sphinx.ext.extlinks to conf.py

* Drop py2.7 and add 3.7 and 3.8 to testing (#135)

* Drop 2.7 and add 3.7 and 3.8 to testing, update docs.

* creating DatetimeIndex directly is deprecated, switch to pd.date_range

* require pandas < 1.0.0

* bump requirements.txt numpy to 1.17.3 for testing on py3.8

* more requirements.txt updates for py3.8 wheel availability

* Update v2.0.0.rst

* convert README.md to ReSt in index.rst, move images folder into sphinx source

* Fix formatting, fix conf.py images folder

* Fix crosslinks and image size

* mention soiling

* another crosslink

* Improve module-level docstrings (#137)

* Improve module docstrings for sphinx docs module summaries

* Update v2.0.0.rst

* pare down readme.md

* incorporate new rdtools draft mission statement

* Add developer notes section to sphinx docs (#136)

* Add developer notes page and update setup.py with doc reqs

* improve formatting in developer_notes.rst

* missed a couple formatting issues

* change RTD to use setuptools extras instead of sphinx_requirements.txt

* add ipython to doc requirements

* change backslashes to forward slashes because they work on windows too.  also remove unnecessary note about ipython

* cleanup

* Update v2.0.0.rst

* add [test] requirements to setup.py

* update developer notes with more detailed installation instructions

* add code requirements section

* Add coverage instructions and configuration

* link typo

* simplify pytest instructions

* clarify installing rdtools from local git repo

* Bump bleach from 2.1.3 to 3.1.1 in /docs (#149)

Bumps [bleach](https://github.com/mozilla/bleach) from 2.1.3 to 3.1.1.
- [Release notes](https://github.com/mozilla/bleach/releases)
- [Changelog](https://github.com/mozilla/bleach/blob/master/CHANGES)
- [Commits](mozilla/bleach@v2.1.3...v3.1.1)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* rerun `versioneer install` to fix v-prefix issue (#153)

* Cherry-pick the plotting module out of the system analysis branch (#138)

* cherry-pick the plotting module commit

* add module-level docstring

* make plotting module docstrings numpydoc-compliant

* update deg/soiling example to use plotting functions

* add plotting module to api.rst

* fix crosslinks

* add matplotlib to setup.py

* update requirements.txt matplotlib for 3.8 testing

* update changelog

* add bins parameter to plotting.degradation_summary_plot from #132

* add basic plotting tests

* exercise all kwargs in plotting tests

* simplify pytest fixture; test kwargs in separate functions

* missed one

* fancy error messages

* Clean up errant spaces

* remove normalize_with_pvwatts import

Co-authored-by: Michael Deceglie <[email protected]>
Co-authored-by: Michael Deceglie <[email protected]>

* fix typo

* make introductions more approachable to non-specialists

* docs cleanup

* improve contributing notes

* drop m2r requirement since index.rst isn't generated from readme.md anymore

* remove m2r from conf.py

* requested changes

* hyphen

* Remove low power cutoff in filtering.clipping_filter (#144)

* remove low power cutoff in filtering.clipping_filter

* Update v2.0.0.rst

* shame on me for not running tests locally

* Update degradation_and_soiling_example.ipynb

* Update degradation_and_soiling_example.ipynb

* change normalized filter to > 0.01 per internal discussion

* Workaround for reindexing bug in Pandas 1.0.0 (#142)

* tentative workaround for pandas 1.0.0 reindexing bug

* Bump requirements to Pandas <= 1.0.0 for Travis upgrade-strategy=eager pytests

* update pandas req to exclude 1.0.0, 1.0.1

* Revert "tentative workaround for pandas 1.0.0 reindexing bug"

This reverts commit 9b69a9d.

* setup.py version lists are combined with AND, so <1.0.0, >=1.0.2 wasn't valid

Co-authored-by: cdeline <[email protected]>

* Remove conflicting reqs (#164)

* Remove conflicting reqs

Some packages were specified in both notebook_requirements.txt and requirements.txt. In some cases versions conflicted.

* Update requirements.txt with indirect requirements

* Run notebook

* Add a note to first install requirements.txt

* Notebook updates

-Add directions to install both requirement files
-Incorporate bugfix from #166

* Changelog update

* Apply suggestions to changelog

Co-Authored-By: Kevin Anderson <[email protected]>

Co-authored-by: Kevin Anderson <[email protected]>

* Update normalization.irradiance_rescale and create irradiance_rescale_test.py (#152)

* Create irradiance_rescale_test.py

* pep8 spaces

* NameError -> UnboundLocalError

* expose convergence_threshold and default method to 'iterative'

* bugfix

* allow max_iterations=0

* bugfix

* changelog

Co-authored-by: Michael Deceglie <[email protected]>

* Empty soiling intervals bugfix (#169)

* Closes #129 bug for invalid soiling intervals

* changelog entry

* Add a test to catch nan soiling interval bug

* clean up comment indentation

* SRR fixes (#154)

* fix precipitation frequency bug

* doc typo

* Normalized filter cherrypick (#139)

* Add normalized_filter() function to replace the mannual filter in example

* update docstring

* add entry to api.rst

* update changelog

* update lower bound to 0.01

* changelog for notebook changes

* add normalized_filter test to exercise default lower bound

Co-authored-by: Michael Deceglie <[email protected]>

* update soiling docstrings to mention soiling stations and aggregation (#165)

* capitalize the SRR class name (#168)

* rename srr_analysis to SRRAnalysis

* formatting fix

* changelog

* Miscellaneous cleanups (#162)

* remove __future__ imports

* normalize_with_sapm duplicate lines

* setup.py status from beta to production/stable

* Delete build.bat

* copyright to 2020 in license and sphinx conf

* changelog for energy_from_power, normalize_with_x (#172)

* changelog for energy_from_power, normalize_with_x

* revise changelog

* migrate to pvlib>=0.7.0 (#170)

* migrate to pvlib >=0.7.0

* update SAPM normalization docstrings to mention racking_model and module_type

* update sapm normalization test to specify module_type

* bump docs pvlib requirement to 0.7.1

* Update rdtools/normalization.py

Co-Authored-By: Cliff Hansen <[email protected]>

* don't use keyword names for sapm_celltemp

Co-authored-by: Cliff Hansen <[email protected]>

* better GitHub links in documentation (#156)

* tentative fix

* fix slash

* include branch logic based on RTD version

* small improvement

* omit GH link element if not building development or master

* change github link text to reflect the destination branch

* link changelog page to changelog GH folder instead of the template rst file

* bugfix

* Generalized model normalizaiton (#173)

* Add normalize_with_expected_power() and refactor normalization module

* make minor adjustments to normalize_with_expected_power

* Add tests for normalize_with_expected_power

* update changelog

* update docstring

Co-authored-by: Kevin Anderson <[email protected]>

* Apply suggestions from code review

Co-authored-by: Kevin Anderson <[email protected]>

* Change test file name

* code formatting fixes

* simplify conditional

* return energy and insolation on same index

* minor changelog update

* add new function to __init__.py and api.rst

Co-authored-by: Kevin Anderson <[email protected]>

* Include emacs auto-save and backup files in gitignore (#146)

* Add example notebook using the NREL PVDAQ #4 system (#171)

* Create degradation_and_soiling_example_sanyo.ipynb

* various typos

* change weather columns based on inspection; rename nz_mask to normalized_mask; improve soiling analysis

* bump pandas, pvlib, and statsmodels versions in requirements.txt

* add discussion; rerun notebook

* rerun original notebook with new requirements to remove warnings

* update pvlib links in notebooks to fix rendering on RTD

* use sanyo example for the RTD page

* changelog

* clean up labeling

* Notebook updates

-Update the notebook to use a more pronounced soiling signal
-Comment updates
-use normalized_filter()
-Use default behavior of infer_freq() and energy_from_power()

* Update docs/degradation_and_soiling_example_pvdaq_4.ipynb

Co-authored-by: Kevin Anderson <[email protected]>

* Update docs/degradation_and_soiling_example_pvdaq_4.ipynb

Co-authored-by: Kevin Anderson <[email protected]>

* Update notebook to use new normalize_with_expected_power()

* limit notebook line length to 90 characters

* Update notebook with data location on datahub

* add pickle to gitignore

* Cache data and fix typo

Co-authored-by: Michael Deceglie <[email protected]>

* add the logo to documentation home page (#174)

* add logo to index.rst

* Update logo_horizontal_highres.png

* Add logo to readme (#178)

* Add logo to readme

* Shrink logo

* update DKASC link (#180)

* SRR precipitation changes (#176)

* remove "clean_wo_precip", add "clean_criterion"

* loop to cumulative sum

* missed some changes

* add min_interval_length parameter to SRR

* clean up code formatting

* Move clean event outage and consecutive day logic to after cleaning events are established

* Add precip and shift options for clean_criterion

* Add precip_threshold

* Update precipitation cleaning detection logic

Use a three day window only for precip_and_shift case

* Update docstrings about when precipitation is used

* update soiling test for precip behavior

* rerun notebooks

pvdaq4 notebook unaffected

* break a docstring line

* update the changelog

* docstring typo

* change log typo fix

Co-authored-by: Kevin Anderson <[email protected]>

* Review updates

* splat kwargs in test

* remove random_seed

Co-authored-by: Michael Deceglie <[email protected]>

* Change interpolate max_timedelta to 2x median, add warning (#182)

* change threshold, add warning, update tests

* fix how exclusion warning is calculated, rerun notebooks

* changelog

* add license file to manifest (#183)

* Overview update (#186)

* Overview update

I suggest slightly rephrasing the overview.

* Add change to readme

* Add GitHub templates and Code of Conduct (#184)

* Create pull_request_template.md

* add default github templates

* improvements from review

* Comply with pv-terms (#185)

* first pass at pvterms compat

* change back to `gamma_pdc`

* docstring update power->energy

* Capitalize Celsius

* dc_power to power_dc (local variable)

* modeled_irrad to irrad_sim

* 1time_series` to `power`

* add simultated to docstring

* update test with gamma_pdc

* Fix failing tests Possibly related to a pandas update rather than anything in RdTools

* Update soiling attributes

* pvwatts kwargs docstring update

* Updated example notebooks: 'tempco' = 'gamma_pdc'; 'wind' = 'wind_speed'

* Pandas > 1.0 requires explicit registering of matplotlib converters.

* update normalize_with_pvwatts and clearsky_pvwatts_kws keywords. Pref-> power_dc_rated.

* Add sphinx requirements to requirements.txt

* Update API example in index.rst.  Add #185 updates to whatsnew

* Add specific kwarg values that have changed

Co-authored-by: Michael Deceglie <[email protected]>
Co-authored-by: cdeline <[email protected]>

* Update changelog with 2.0b0 release date

Co-authored-by: Michael Deceglie <[email protected]>
Co-authored-by: Michael Deceglie <[email protected]>
Co-authored-by: Kevin Anderson <[email protected]>
Co-authored-by: Kevin Anderson <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cliff Hansen <[email protected]>
Co-authored-by: Will Vining <[email protected]>
  • Loading branch information
8 people authored Jul 31, 2020
1 parent fddefeb commit 8f00cd4
Show file tree
Hide file tree
Showing 51 changed files with 5,622 additions and 1,133 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[run]
omit =
# _version.py doesn't count
rdtools/_version.py
# omit the test files themselves
rdtools/test/*
5 changes: 5 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Contributing
============

See the contributing page on ReadTheDocs:
[contributing](https://rdtools.readthedocs.io/en/latest/developer_notes.html#contributing)
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**Full error message and traceback**
Please copy/paste the entire error traceback, if applicable.

**To Reproduce**
Steps to reproduce the behavior.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
5 changes: 5 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- [ ] Code changes are covered by tests
- [ ] New functions added to `__init__.py`
- [ ] API.rst is up to date, along with other sphinx docs pages
- [ ] Example notebooks are rerun and differences in results scrutinized
- [ ] Updated changelog
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# ignore coveralls yaml, coverge dir
.coveralls.yml
.coverage
htmlcov/

# ignore test cache
.pytest_cache
Expand All @@ -19,8 +20,18 @@
docs/.ipynb_checkpoints/degradation_example-checkpoint.ipynb
*.ipynb_checkpoints*

# sphinx docs build
docs/sphinx/source/generated

# ignore setup and egg-info
.eggs/
build/
dist/
rdtools.egg-info*

# emacs temp files
*~
\#*\#
.\#*

*.pickle
6 changes: 6 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
python:
version: 3.6
use_system_site_packages: true
pip_install: true
extra_requirements:
- doc
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ sudo: false
language: python

python:
- "2.7"
- "3.6"
- "3.7"
- "3.8"

# Test two environments:
# 1) dependencies with pinned versions from requirements.txt
Expand All @@ -25,6 +26,8 @@ install:
script:
- pytest

# Deploy to pypi on the python 3.6 build with upgraded dependencies when
# a new version is tagged on github from the master branch
deploy:
provider: pypi
user: RdTools
Expand All @@ -33,6 +36,8 @@ deploy:
on:
tags: true
branch: master
python: 3.6
condition: $REQ_ENV == '--upgrade --upgrade-strategy=eager .'
distributions: "sdist bdist_wheel"
skip_cleanup: true
skip_existing: true
76 changes: 76 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include versioneer.py
include rdtools/_version.py
include rdtools/data/*
include rdtools/data/*
include LICENSE
126 changes: 23 additions & 103 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,120 +1,40 @@
# About RdTools
<img src="./docs/sphinx/source/_images/logo_horizontal_highres.png" width="500" alt="RdTools logo"/>

Master branch: [![Build Status](https://travis-ci.org/NREL/rdtools.svg?branch=master)](https://travis-ci.org/NREL/rdtools)
Development branch: [![Build Status](https://travis-ci.org/NREL/rdtools.svg?branch=development)](https://travis-ci.org/NREL/rdtools)
Master branch:
[![Build Status](https://travis-ci.org/NREL/rdtools.svg?branch=master)](https://travis-ci.org/NREL/rdtools)

RdTools is a set of Python tools for analysis of photovoltaic data.
In particular, PV production data is evaluated over several years
to obtain rates of performance degradation over time. RdTools can
handle both high frequency (hourly or better) or low frequency (daily, weekly, etc.)
datasets. Best results are obtained with higher frequency data.
Development branch:
[![Build Status](https://travis-ci.org/NREL/rdtools.svg?branch=development)](https://travis-ci.org/NREL/rdtools)

Full examples are worked out in the example notebooks in [rdtools/docs](./docs/degradation_example.ipynb).
RdTools is an open-source library to support reproducible technical analysis of
time series data from photovoltaic energy systems. The library aims to provide
best practice analysis routines along with the building blocks for users to
tailor their own analyses.
Current applications include the evaluation of PV production over several years to obtain
rates of performance degradation and soiling loss. RdTools can handle
both high frequency (hourly or better) or low frequency (daily, weekly,
etc.) datasets. Best results are obtained with higher frequency data.

## Workflow

0. Import and preliminary calculations
1. Normalize data using a performance metric
2. Filter data that creates bias
3. Aggregate data
4. Analyze aggregated data to estimate the degradation rate


<img src="./screenshots/Workflow1.png" width="600" height="331" alt="RdTools Workflow"/>

## Degradation Results

The preferred method for degradation rate estimation is the year-on-year (YOY) approach,
available in `degradation.degradation_year_on_year`. The YOY calculation yields in a distribution
of degradation rates, the central tendency of which is the most representative of the true
degradation. The width of the distribution provides information about the uncertainty in the
estimate via a bootstrap calculation. The [example notebook](./docs/degradation_example.ipynb) uses the output of `degradation.degradation_year_on_year()`
to visualize the calculation.

<img src="./screenshots/Clearsky_result_updated.png" width="600" height="456" alt="RdTools Result"/>


Two workflows are available for system performance ratio calculation, and illustrated in an example notebook.
The sensor-based approach assumes that site irradiance and temperature sensors are calibrated and in good repair.
Since this is not always the case, a 'clear-sky' workflow is provided that is based on
modeled temperature and irradiance. Note that site irradiance data is still required to identify
clear-sky conditions to be analyzed. In many cases, the 'clear-sky' analysis can identify conditions
of instrument errors or irradiance sensor drift, such as in the above analysis.


## Install RdTools using pip

RdTools can be installed automatically into Python from PyPI using the command line:
`pip install rdtools`

Alternatively it can be installed manually using the command line:

1. Download a [release](https://github.com/NREL/rdtools/releases) (Or to work with a development version, clone or download the rdtools repository).
2. Navigate to the repository: `cd rdtools`
3. Install via pip: `pip install .`

On some systems installation with `pip` can fail due to problems installing requirements. If this occurs, the requirements specified in `setup.py` may need to be separately installed (for example by using `conda`) before installing `rdtools`.

RdTools currently runs in both Python 2.7 and 3.6.

## Usage and examples


Full workflow examples are found in the notebooks in [rdtools/docs](./docs/degradation_example.ipynb). The examples are designed to work with python 3.6. For a consistent experience, we recommend installing the packages and versions documented in `docs/notebook_requirements.txt`. This can be achieved in your environment by first installing RdTools as described above, then running `pip install -r docs/notebook_requirements.txt` from the base directory.

The following functions are used for degradation analysis:
RdTools can be installed automatically into Python from PyPI using the
command line:

```
import rdtools
pip install rdtools
```

The most frequently used functions are:
For API documentation and full examples, please see the [documentation](https://rdtools.readthedocs.io).

```Python
normalization.normalize_with_pvwatts(energy, pvwatts_kws)
'''
Inputs: Pandas time series of raw energy, PVwatts dict for system analysis
(poa_global, P_ref, T_cell, G_ref, T_ref, gamma_pdc)
Outputs: Pandas time series of normalized energy and POA insolation
'''
```

```Python
filtering.poa_filter(poa); filtering.tcell_filter(Tcell); filtering.clip_filter(power);
filtering.csi_filter(insolation, clearsky_insolation)
'''
Inputs: Pandas time series of raw data to be filtered.
Output: Boolean mask where `True` indicates acceptable data
'''
```

```Python
aggregation.aggregation_insol(normalized, insolation, frequency='D')
'''
Inputs: Normalized energy and insolation
Output: Aggregated data, weighted by the insolation.
'''
```

```Python
degradation.degradataion_year_on_year(aggregated)
'''
Inputs: Aggregated, normalized, filtered time series data
Outputs: Tuple: `yoy_rd`: Degradation rate
`yoy_ci`: Confidence interval `yoy_info`: associated analysis data
'''
```
RdTools currently is tested on Python 3.6+.

## Citing RdTools

The underlying workflow of RdTools has been published in several places. If you use RdTools in a published work, please cite the following:
The underlying workflow of RdTools has been published in several places. If you use RdTools in a published work, please cite the following as appropriate:

- D. Jordan, C. Deline, S. Kurtz, G. Kimball, M. Anderson, "Robust PV Degradation Methodology and Application",
IEEE Journal of Photovoltaics, 2017
- D. Jordan, C. Deline, S. Kurtz, G. Kimball, M. Anderson, "Robust PV Degradation Methodology and Application", IEEE Journal of Photovoltaics, 8(2) pp. 525-531, 2018
- M. G. Deceglie, L. Micheli and M. Muller, "Quantifying Soiling Loss Directly From PV Yield," in IEEE Journal of Photovoltaics, 8(2), pp. 547-551, 2018
- RdTools, version x.x.x, https://github.com/NREL/rdtools, [DOI:10.5281/zenodo.1210316](https://doi.org/10.5281/zenodo.1210316)
*(be sure to include the version number used in your analysis)*



## References
The clear sky temperature calculation, `clearsky_temperature.get_clearsky_tamb()`, uses data
Expand All @@ -124,10 +44,10 @@ https://neo.sci.gsfc.nasa.gov/view.php?datasetId=MOD_LSTN_CLIM_M

Other useful references which may also be consulted for degradation rate methodology include:

- D. C. Jordan, M. G. Deceglie, S. R. Kurtz, PV degradation methodology comparison — A basis for a standard, in 43rd IEEE Photovoltaic Specialists Conference, Portland, OR, USA, 2016, DOI: 10.1109/PVSC.2016.7749593.
- D. C. Jordan, M. G. Deceglie, S. R. Kurtz, "PV degradation methodology comparison — A basis for a standard", in 43rd IEEE Photovoltaic Specialists Conference, Portland, OR, USA, 2016, DOI: 10.1109/PVSC.2016.7749593.
- Jordan DC, Kurtz SR, VanSant KT, Newmiller J, Compendium of Photovoltaic Degradation Rates, Progress in Photovoltaics: Research and Application, 2016, 24(7), 978 - 989.
- D. Jordan, S. Kurtz, PV Degradation Rates – an Analytical Review, Progress in Photovoltaics: Research and Application, 2013, 21(1), 12 - 29.
- E. Hasselbrink, M. Anderson, Z. Defreitas, M. Mikofski, Y.-C.Shen, S. Caldwell, A. Terao, D. Kavulak, Z. Campeau, D. DeGraaff, Validation of the PVLife model using 3 million module-years of live site data, 39th IEEE Photovoltaic Specialists Conference, Tampa, FL, USA, 2013, p. 7 – 13, DOI: 10.1109/PVSC.2013.6744087.
- E. Hasselbrink, M. Anderson, Z. Defreitas, M. Mikofski, Y.-C.Shen, S. Caldwell, A. Terao, D. Kavulak, Z. Campeau, D. DeGraaff, "Validation of the PVLife model using 3 million module-years of live site data", 39th IEEE Photovoltaic Specialists Conference, Tampa, FL, USA, 2013, p. 7 – 13, DOI: 10.1109/PVSC.2013.6744087.

## Further Instructions and Updates

Expand Down
Loading

0 comments on commit 8f00cd4

Please sign in to comment.