pvlib-python
pvlib-python copied to clipboard
Replace freq '1M' with '1MS'
- [x] I am familiar with the contributing guidelines
- [x] Tests added
- [ ] Adds description and name entries in the appropriate "what's new" file in
docs/sphinx/source/whatsnew
for all changes. Includes link to the GitHub Issue with:issue:`num`
or this Pull Request with:pull:`num`
. Includes contributor name and/or GitHub username (link with:ghuser:`user`
). - [x] New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
- [x] Pull request is nearly complete and ready for detailed review.
- [x] Maintainer: Appropriate GitHub Labels (including
remote-data
) and Milestone are assigned to the Pull Request and linked Issue.
The freq='1M'
is used in a couple of places in the pvlib iotools functions, which results in the following future warning:
FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead. months = pd.date_range(
The frequency 'M' is being phased out in favor of 'ME' and 'MS' which correspond to month end and month start. 'M' is equivalent to 'ME'. However, 'MS' is the only one supported in our minimum Pandas version, whereas 'ME' was first introduced in a later version. For the iotools functions, I think 'MS' is conceptually more correct.
Minimum changes to the lookup linked turbidity functions were made to make tests pass. I preferred making these modifications over calculating new test values.