Add deprecation warning for irradiance.king#2783
Conversation
|
Some minor edits to the tests are needed in order to prevent cluttering the CI output: https://github.com/pvlib/pvlib-python/actions/runs/27539135408/job/82221477466?pr=2783#step:9:84 pytest offers a way to ensure that warnings are emitted while also suppressing them from the logs. Check #1401 for an example of how to use it. |
|
|
||
| @deprecated( | ||
| since="0.15.2", | ||
| removal="", |
There was a problem hiding this comment.
| removal="", | |
| removal="0.17.0", |
|
I checked the red This minimal patch clears the flake8 command locally: diff --git a/pvlib/iotools/pvgis.py b/pvlib/iotools/pvgis.py
@@
- tzname = pytz.timezone(f'Etc/GMT{-tz:+d}')
+ tzname = pytz.timezone('Etc/GMT{:+d}'.format(-tz))
diff --git a/pvlib/location.py b/pvlib/location.py
@@
- self._zoneinfo = zoneinfo.ZoneInfo(f"Etc/GMT{-tz_:+d}")
+ self._zoneinfo = zoneinfo.ZoneInfo("Etc/GMT{:+d}".format(-tz_))
@@
- self._zoneinfo = zoneinfo.ZoneInfo(f"Etc/GMT{-int(tz_):+d}")
+ offset = -int(tz_)
+ self._zoneinfo = zoneinfo.ZoneInfo("Etc/GMT{:+d}".format(offset))
diff --git a/tests/iotools/test_midc.py b/tests/iotools/test_midc.py
@@
import pandas as pd
import pytest
-import pytzI verified the lint with the CI-style command on Python 3.12: git diff origin/main HEAD -- "*.py" | uv run --python 3.12 --with flake8==5.0.4 flake8 --exclude pvlib/version.py --ignore E201,E241,E226,W503,W504 --max-line-length 79 --diffI also ran related tests, but my local minimal |
|
Has something changed in the CI? I thought the linter (flake8) was set to only check lines that are being changed. |
|
I do not think the CI changed. The flake8 job is still diff-only, but it runs a two-dot diff: git diff upstream/$GITHUB_BASE_REF HEAD -- "*.py" | flake8 ... --diffSo it checks lines that differ between current I verified that locally: git diff origin/main HEAD -- "*.py" # includes the lint-failing files
git diff origin/main...HEAD -- "*.py" # only pvlib/irradiance.pySo the linter is still checking changed diff lines, but the two-dot comparison makes unrelated main-branch drift visible when the PR branch is behind/current-main-divergent. Rebasing/merging current main, or applying the small lint-only patch I posted above, should clear that job. |
I attest that all AI-generated material has been vetted for accuracy and is in compliance with the pvlib licenseTests addeddocs/sphinx/source/referencefor API changes.docs/sphinx/source/whatsnewfor 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`).New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.remote-data) and Milestone are assigned to the Pull Request and linked Issue.