You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix read_tmy3 with year coerced not monotonic, breaks soiling (#910)
* fix soiling_hsu for tmy not monotonic
* if tmy is coerced to year, then the last hour is in the same year,
before the other timestamps, so timestamps are no monotonic
* closes#889
* add underscore to is_tmy
* add is_tmy to soiling_hsu
* add private _fix_tmy_monotonicity
* also fix reference footnote in first line of docstring,
since used in api.rst, causes doc warning
* don't use mutable input args
* don't create pd.timedelta object every single time soiling_hsu() called
* always create soiling pd.Series for consistency and robust to future edits
* fix rain_index is not a tz-aware pd.DatetimeIndex series,
so rename as rain_index_vals and use rainfall.index in Soiling
* add new test for gh889, check soiling ratio for 24 hours,
and check timestamp of first and last hours, and last day
* update what's new with fix for TMY3 in soiling_hsu
* also change 1st line of kimber soiling docstring, to say calculates
energy loss, not soiling ratio, since kimber is 1-hsu,
they're opposite!
* move fix_tmy_monotonicity to tmy in iotools
* and remove it from losses, remove is_tmy args, and remove calls to
fix tmy monotonicity
* test to make sure if coerced year, last record is Jan 1 of next year
* add fix_tmy3_coerce_year_monotonicity to iotools api
* revert changes to soiling_hsu, don't use private constants for
rain accumulation period or deposition velocity
* update kimber soiling example in gallery
- to use fix_tmy3_coerce_year_monotonicity
- and not use conftest, instead build path
- also better comments
* remove test for gh889 in test_losses
* apply fix to greensboro rain data fixture and remove is_tmy args from kimber tests
* add needs_pandas_0_22 to soiling_hsu tests to show that it is required,
since requies_scipy masks the requirement
* fix path to data in kimber example
* add test for HSU soiling defaults for coverage
* fix iotools api stickler warning
* remove unused pytz import in test_losses
* update what's new and api.rst with fix_tmy3_coerce_year_monotonicity
* parameters spelling typo in fix_tmy3_monotonicity docstring
* also move reference in kimber soiling example to comment in first code cell
* add monotonic_index kwarg to read_tmy3
* change name to tmy3_monotonic_index
* set monotonic_index default to false but warn that
this will change to True in v0.8
* improve tmy3_monotonic_index docstring with reviewer comments, and add
note to call only after read_tmy3 with coerce year,
to use monotonic_index=True to combine calls, and that there's no validation
that input TMY3 has been coerced or if it has already been fixed
* also if only used for TMY3 no need to calculate timestep interval,
it's always 1-hour
* that's all folks
* update what's new with monotonic_index kwarg
* Update pvlib/tests/iotools/test_tmy.py
* change test name to `test_tmy3_monotonic_index`
Co-Authored-By: Cliff Hansen <cwhanse@sandia.gov>
* fix bug in read_tmy3 when year coerced
- so the indices are monotonically increasing
- add note to API changes and update bug fix in what's new
- update docstring in read_tmy3
* explain in coerce_year parmaeter that all of the indices except the
last one will have this, value, but the last index will be the value+1
- update the warnings to explain that if the year is coerced that the last index
will be the next year
- do coerce year on date_ymd which is a Series of Timestamps, not an
index so mutable (can assign by integer index) which makes it trivial
to change the last index to be the next year
- revert most of the changes from the previous commits in this PR
* remove `tmy3_monotonic_index` from `api.rst`, `iotools/__init__.py`, and from `tmy.py`
* remove `monotonic_index` kwarg from read_tmy3
* remove use of `tmy3_monotonic_index` from sphinx gallery example,
test_losses, and test_tmy
* remove test for tmy3_monotonic_index and the monotonic_index kwarg
* fix test_tmy test to treat last index differently, except for the
leap year test which now has a constant diff, yay!
* stickler: rm unused imports from tmy, test
* suggested changes in read_tmy3 for monotonic index
* sed s/data/index/g
* wordsmithing docstring: coerce_year kwarg
* wordsmithing what's new bug fixes
* also consistently use periods for bullets in what's new
* Apply suggestions from code review to test last hour in read_tmy3
* and minor wordsmithing in what's new
Co-Authored-By: Will Holmgren <william.holmgren@gmail.com>
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
Co-authored-by: Will Holmgren <william.holmgren@gmail.com>
0 commit comments