Skip to content

Conversation

@kandersolar
Copy link
Member

@kandersolar kandersolar commented Nov 2, 2020

  • 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

Most of the diff is self-explanatory, but shifting fixtures around deserves an explanation: if a fixture is needed in multiple files, it is recommended to house it in conftest.py, which automatically makes it available to all test files. I made that change here because flake8 took significant offense at us directly importing across test files, but we probably should have been doing it anyway.

FYI: I set the max line length to 99 characters as a starting point but that's up for discussion if anyone prefers a different value.

@mdeceglie
Copy link
Collaborator

Since we do have a testing section of the change log, I think it would make sense to add something now that we have new testing scope. Also some additional breadcrumbs about the shared fixtures in the changelog might be good. Other than that, looks good to me.

@kandersolar kandersolar mentioned this pull request Nov 9, 2020
5 tasks
@mdeceglie mdeceglie self-requested a review November 10, 2020 14:12
@kandersolar
Copy link
Member Author

From internal discussion with @mdeceglie we decided to limit the lint check to PR diffs (instead of the entire codebase) so that we can choose to merge non-compliant code (e.g. test files) without causing irrelevant failures in future PRs.

The new workflow configuration is a little more complex, but it seems to work: https://github.com/NREL/rdtools/pull/231/checks?check_run_id=1381245386#step:6:8

@mdeceglie mdeceglie requested a review from cdeline November 10, 2020 18:51
Copy link
Collaborator

@cdeline cdeline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this looks like a good addition to have a linter check pull requests. I'll probably need help to modify my analysis_test.py to match the new organization of test fixtures.

@kandersolar kandersolar changed the base branch from development to release/2.0.5 December 28, 2020 23:19
kandersolar and others added 14 commits December 28, 2020 16:21
* Add normalized_filter() function to replace the mannual filter in example

* Initial working system analysis class

* system analysis version that reproduces notebook results

Works for both sensor and clearsky workflows

* Improve underlying analysis

These improvements slightly change the clearsky results relative to the existing version of the notebook.

* Allow poa, temperature, and temperature_coefficient to be None

This leaves room for BYO modeled PV perofmrance in the future

* Add system_analysis to rdtools namespace

* Basic example of system_analysis() use

* Update degradation_and_soiling_example.ipynb

1) Use apparent zenith in irradiance calculations instead of zenith
2) Apply clearsky filter based on poa irradiance rather than insolation
3) Include ground diffuse in irradiance transposition calculations

* Update system_analysis_example notebook

Update notes and change initial poa calculation to include ground diffuse

* Add a plotting module

* Update notebook to use plotting module

* Add plotting methods

* update system_analysis example notebook

* add docstrings

* Delete model chain dev notes

* add matplotlib to setup.py and update requirements

* change matplotlib version

* Move docstring to class

* renormalization bug fix

* Update temperature input interface

(Also fix merge bug in plotting)

* update docstring for new temperature interface

* Remove __init__ docstring

* update class name to CamelCase

* update kwarg explanatations in docstrings

* remove model parameter from calc_clearsky_poa()

It is still addressable through kwargs passed to pvlib

* Update SystemAnalysis_example.ipynb

* Reformat dosctrings to numpy style

* command style docstrings

* Remove duplicate line

* Update plotting docstrings to numpy style

* Format normalized_filter docstring according to numpy style

Other docstrings in this module have been updated in #125

* Add an ad hoc filter example to the notebook

* Fixes system_analysis bug #132 when pv_nameplate is passed into syste… (#133)

* Fixes system_analysis bug #132 when pv_nameplate is passed into system_analysis object.

* typo fix

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

* add bins parameter to plotting.degradation_summary_plot from #132

(cherry picked from commit efcbe2e)

* plotting bug fix

* 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

* add matplotlib to requirements

* matplotlib 3.1

* matplotlib

* merge pytests and jupyter example

* PVLib > 0.7 changes to cell_temp calculation

* Modelchain pytests (#196)

* pytests for system_analysis.  coverage: 91%.

* rename system_analysis.py to analysis.py. Rename class to RdAnalysis. Update pvwatts_kws to match Master updates

* Allow temp_model_params to either be string or dict with 'a','b', 'deltaT' keys

* update calc_cell_temperature for pvlib > 0.6.3, use energy_normalized in normalize_with_pvwatts

* Warn if temp coefficient not passed into normalize_with_Pvwatts instead of exit with error.

* Add tables=3.6.1 to requirements.txt to allow clearsky analysis

* add tables to setup.py since it appears to be a required pvlib for the clearsky workflow and not installed by default.

* Add RdAnalysis notebook for pvdaq4 system

* add max_timedelta=15T and clearsky poa calculation update to pvdaq4 standard notebook example

* Sphinx release notes for 2.1.0 updated and API update

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

* Update tests, include tables in setup.py

* suppress import warnings for soiling module.

* Change warning suppression from warnings.resetwarnings to with warnings.catch_warnings().
Re-run notebooks

* Model chains exp energy (#232)

* enable normalize_with_expected_energy.

* Update RdAnalysis_example.ipynb with manually defined power_expected option.

* Add post-filter error check for < 2 yrs data per kanderson

* Remove error message for no thermal model if power_expected is passed in.

* remove tcell_filter from filter list if power_expected is passed in but not cell_temperature

* pep8 compliance

* more robust frequency check

* shorten long lines

* Model chains set clearsky (#233)

* Move CS inputs to new set_clearsky function: pvlib_location ,pv_tilt, pv_azimuth, clearsky_poa, clearsky temp, albedo

* Explicit error message if set_clearsky not run prior to clearsky_analysis.

* remove Py2.7 check in block 3 of RdAnalysis_example.ipynb

* boost analysis.py test coverage to 94%

* add pv_energy pytest case. Change to ValueError rather than basic Exception when set_clearsky hasn't been run.

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

* improve index equality conditional

* pep8 cleanup

* change dict key syntax

* Clarify behavior when pv_nameplate is omitted

* Useful errors for plotting methods

* update requreiments for tables

* reduce minimum version of tables

* Delete RdAnalysis_example.ipynb

* Remove max_timedelta parameter use in PVDAQ example

* Move sun position calculation to clearsky section of example

This brings the clearsky results into better allignement with the objected oriented example, now sun position is calculated after interpolation on both

* Update chage log version number

* Allow warning for experimental modules

* pep8 analysis_test.py

* Change module and class names

* Update example with new module/class name

* Fix outdated ref to system_analysis

* Update api.rst with analysis chains module name

* Fix changelog underline length

* update index.rst with TrendAnalysis info

* poa -> poa_global

* cell_temperature -> temperature_cell

* ambient_temperature->temperature_ambient

* temperature_coefficient->gamma_pdc

* temperature_model docstring

* pv_nameplate->power_dc_rated

* clearsky_poa->poa_global_clearsky

* clearsky_temperature_cell->temperature_cell_clearsky

* clearsky_temperature_ambient->temperature_ambient_clearsky

* Align yoy and srr parameters with functional API

* Use `case` in plotting methods

* Change notebook kernel

* weakly privatize some methods

* Update rdtools/analysis_chains.py

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

* Interpolate windspeed

* Update rdtools/analysis_chains.py

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

* implement review suggestions

* more TrendAnalysis tests to improve coverage

* cleanup

* Fix copy/paste error in notebook

* change _calc_cell_temeprature parameter order

* More elegant error if filtering results in empty series

* Changelog consolidation

* change log update

Co-authored-by: cdeline <[email protected]>
Co-authored-by: Kevin Anderson <[email protected]>
Co-authored-by: Kevin Anderson <[email protected]>
@kandersolar
Copy link
Member Author

@mdeceglie I rebased this on release/2.0.5. I guess we can cherrypick (or just recreate) the analysis_chains fixes in a separate PR to development.

@mdeceglie mdeceglie merged commit 6454cc8 into release/2.0.5 Dec 29, 2020
@mdeceglie mdeceglie deleted the flake8_compat branch December 29, 2020 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants