From c1f37c5190e4cd9df41ca545f8e878a24ccdf44a Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Wed, 1 May 2024 07:51:44 -0400 Subject: [PATCH 1/9] require python >=3.8 --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a24d1ced6c..de51b7c22c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ description = "A set of functions and classes for simulating the performance of authors = [ { name = "pvlib python Developers", email = "pvlib-admin@googlegroups.com" }, ] -requires-python = ">=3.7" +requires-python = ">=3.8" dependencies = [ 'numpy >= 1.17.3', 'pandas >= 1.3.0', @@ -17,7 +17,6 @@ dependencies = [ 'requests', 'scipy >= 1.6.0', 'h5py', - 'importlib-metadata; python_version < "3.8"', ] license = { text = "BSD-3-Clause" } classifiers = [ From 4461abf721acdcdc2c70a0b948d8a55cc0270ab9 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Wed, 1 May 2024 07:52:13 -0400 Subject: [PATCH 2/9] update CI configurations --- .github/workflows/pytest-remote-data.yml | 6 ++-- .github/workflows/pytest.yml | 6 ++-- benchmarks/asv.conf.json | 2 +- ci/requirements-py3.7.yml | 28 ------------------- ...3.7-min.yml => requirements-py3.8-min.yml} | 2 +- readthedocs.yml | 2 +- 6 files changed, 9 insertions(+), 37 deletions(-) delete mode 100644 ci/requirements-py3.7.yml rename ci/{requirements-py3.7-min.yml => requirements-py3.8-min.yml} (96%) diff --git a/.github/workflows/pytest-remote-data.yml b/.github/workflows/pytest-remote-data.yml index 7376901dd6..a894db7c7d 100644 --- a/.github/workflows/pytest-remote-data.yml +++ b/.github/workflows/pytest-remote-data.yml @@ -56,10 +56,10 @@ jobs: strategy: fail-fast: false # don't cancel other matrix jobs when one fails matrix: - python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] + python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] suffix: [''] # the alternative to "-min" include: - - python-version: 3.7 + - python-version: 3.8 suffix: -min runs-on: ubuntu-latest @@ -103,7 +103,7 @@ jobs: run: pytest pvlib/tests/iotools --cov=./ --cov-report=xml --remote-data - name: Upload coverage to Codecov - if: matrix.python-version == 3.7 && matrix.suffix == '' + if: matrix.python-version == 3.8 && matrix.suffix == '' uses: codecov/codecov-action@v4 with: fail_ci_if_error: true diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 8a47d437ed..80f10f0b16 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -12,12 +12,12 @@ jobs: fail-fast: false # don't cancel other matrix jobs when one fails matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] + python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] environment-type: [conda, bare] suffix: [''] # placeholder as an alternative to "-min" include: - os: ubuntu-latest - python-version: 3.7 + python-version: 3.8 environment-type: conda suffix: -min exclude: @@ -82,7 +82,7 @@ jobs: pytest pvlib --cov=./ --cov-report=xml --ignore=pvlib/tests/iotools - name: Upload coverage to Codecov - if: matrix.python-version == 3.7 && matrix.suffix == '' && matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda' + if: matrix.python-version == 3.8 && matrix.suffix == '' && matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda' uses: codecov/codecov-action@v4 with: fail_ci_if_error: true diff --git a/benchmarks/asv.conf.json b/benchmarks/asv.conf.json index 112b2c5c63..919dc923f6 100644 --- a/benchmarks/asv.conf.json +++ b/benchmarks/asv.conf.json @@ -113,7 +113,7 @@ "include": [ // minimum supported versions { - "python": "3.7", + "python": "3.8", "build": "", "numpy": "1.17.5", "pandas": "1.3.0", diff --git a/ci/requirements-py3.7.yml b/ci/requirements-py3.7.yml deleted file mode 100644 index 89999404c7..0000000000 --- a/ci/requirements-py3.7.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: test_env -channels: - - defaults - - conda-forge -dependencies: - - coveralls - - cython - - ephem - - h5py - - numba - - numpy >= 1.17.3 - - pandas >= 1.3.0 - - pip - - pytest - - pytest-cov - - pytest-mock - - requests-mock - - pytest-timeout - - pytest-rerunfailures - - conda-forge::pytest-remotedata # version in default channel is old - - python=3.7 - - pytz - - requests - - scipy >= 1.6.0 - - statsmodels - - pip: - - nrel-pysam>=2.0 - - solarfactors diff --git a/ci/requirements-py3.7-min.yml b/ci/requirements-py3.8-min.yml similarity index 96% rename from ci/requirements-py3.7-min.yml rename to ci/requirements-py3.8-min.yml index f33e3805ce..598a3b5ca9 100644 --- a/ci/requirements-py3.7-min.yml +++ b/ci/requirements-py3.8-min.yml @@ -8,7 +8,7 @@ dependencies: - pytest-cov - pytest-mock - pytest-timeout - - python=3.7 + - python=3.8 - pytz - requests - pip: diff --git a/readthedocs.yml b/readthedocs.yml index a377810054..2aa95e6866 100644 --- a/readthedocs.yml +++ b/readthedocs.yml @@ -8,7 +8,7 @@ version: 2 build: os: ubuntu-20.04 tools: - python: "3.7" + python: "3.8" jobs: # fetch the full history so that setuptools_scm can determine the # correct version string for long PRs with many commits From 58136faf309161c95d2f61b9f6876f8ec2ae7717 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Wed, 1 May 2024 07:52:30 -0400 Subject: [PATCH 3/9] whatsnew --- docs/sphinx/source/whatsnew/v0.10.5.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/sphinx/source/whatsnew/v0.10.5.rst b/docs/sphinx/source/whatsnew/v0.10.5.rst index 9bbb8c9745..49b8614e79 100644 --- a/docs/sphinx/source/whatsnew/v0.10.5.rst +++ b/docs/sphinx/source/whatsnew/v0.10.5.rst @@ -30,6 +30,7 @@ Documentation Requirements ~~~~~~~~~~~~ +* Python 3.8 or higher. (:issue:`1975`, :pull:`2029`) * Minimum version of scipy advanced from 1.5.0 to 1.6.0. (:pull:`2027`) From 584275ce0ebca8cc5673be1ac7aaa875924ce8c7 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Wed, 1 May 2024 07:56:49 -0400 Subject: [PATCH 4/9] remove pre-3.8 cruft --- pvlib/version.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pvlib/version.py b/pvlib/version.py index 781e53797c..faab5f6f75 100644 --- a/pvlib/version.py +++ b/pvlib/version.py @@ -1,8 +1,4 @@ -try: - from importlib.metadata import PackageNotFoundError, version -except ImportError: - # for python < 3.8 - from importlib_metadata import PackageNotFoundError, version +from importlib.metadata import PackageNotFoundError, version try: __version__ = version(__package__) From f428ccdfb0945c7ee3130b981b8137c5c3d73ef4 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Wed, 1 May 2024 08:37:58 -0400 Subject: [PATCH 5/9] fix h5py/numpy versioning issue for py3.8-min --- ci/requirements-py3.8-min.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/requirements-py3.8-min.yml b/ci/requirements-py3.8-min.yml index 598a3b5ca9..ef230b1627 100644 --- a/ci/requirements-py3.8-min.yml +++ b/ci/requirements-py3.8-min.yml @@ -13,7 +13,7 @@ dependencies: - requests - pip: - dataclasses - - h5py==3.1.0 + - h5py==2.10.0 # chosen for compatibility with numpy 1.17.3 and py3.8 - numpy==1.17.3 - pandas==1.3.0 - scipy==1.6.0 From 942d83f676bf8836ef121e4add548af30c59b55f Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Wed, 1 May 2024 08:38:13 -0400 Subject: [PATCH 6/9] update gallery examples for newer pandas --- docs/examples/shading/plot_partial_module_shading_simple.py | 2 +- docs/examples/solar-position/plot_sunpath_diagrams.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/examples/shading/plot_partial_module_shading_simple.py b/docs/examples/shading/plot_partial_module_shading_simple.py index 8f05a80af5..ce031eff10 100644 --- a/docs/examples/shading/plot_partial_module_shading_simple.py +++ b/docs/examples/shading/plot_partial_module_shading_simple.py @@ -317,7 +317,7 @@ def find_pmp(df): results = pd.DataFrame(data) results['pmp'] /= results['pmp'].max() # normalize power to 0-1 -results_pivot = results.pivot('fd', 'fs', 'pmp') +results_pivot = results.pivot(index='fd', columns='fs', values='pmp') plt.figure() plt.imshow(results_pivot, origin='lower', aspect='auto') plt.xlabel('shaded fraction') diff --git a/docs/examples/solar-position/plot_sunpath_diagrams.py b/docs/examples/solar-position/plot_sunpath_diagrams.py index 618d5f9792..3f36d643a6 100644 --- a/docs/examples/solar-position/plot_sunpath_diagrams.py +++ b/docs/examples/solar-position/plot_sunpath_diagrams.py @@ -103,8 +103,7 @@ tz = 'Asia/Calcutta' lat, lon = 28.6, 77.2 -times = pd.date_range('2019-01-01 00:00:00', '2020-01-01', closed='left', - freq='H', tz=tz) +times = pd.date_range('2019-01-01 00:00:00', '2020-01-01', freq='H', tz=tz) solpos = solarposition.get_solarposition(times, lat, lon) # remove nighttime From 6582f81f60a2a8d6218651252b02f227a8a93403 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Thu, 2 May 2024 19:23:00 -0400 Subject: [PATCH 7/9] update asv config for python 3.8 --- benchmarks/asv.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/asv.conf.json b/benchmarks/asv.conf.json index 919dc923f6..311033dd65 100644 --- a/benchmarks/asv.conf.json +++ b/benchmarks/asv.conf.json @@ -121,7 +121,7 @@ // Note: these don't have a minimum in setup.py "h5py": "3.1.0", "ephem": "3.7.6.0", - "numba": "0.40.0" + "numba": "0.47.0", # first version to support py 3.8 }, // latest versions available { From dde1baedf17700ddd9859c92ec22b1dda276f315 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Thu, 2 May 2024 19:25:03 -0400 Subject: [PATCH 8/9] fix asv config syntax error --- benchmarks/asv.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/asv.conf.json b/benchmarks/asv.conf.json index 311033dd65..4af346ca55 100644 --- a/benchmarks/asv.conf.json +++ b/benchmarks/asv.conf.json @@ -121,7 +121,7 @@ // Note: these don't have a minimum in setup.py "h5py": "3.1.0", "ephem": "3.7.6.0", - "numba": "0.47.0", # first version to support py 3.8 + "numba": "0.47.0", // first version to support py 3.8 }, // latest versions available { From 61394356783fb5aa04bf992b1ccccda3120a1fe4 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Thu, 2 May 2024 20:02:56 -0400 Subject: [PATCH 9/9] one more asv config edit --- benchmarks/asv.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/asv.conf.json b/benchmarks/asv.conf.json index 4af346ca55..1ca23419a9 100644 --- a/benchmarks/asv.conf.json +++ b/benchmarks/asv.conf.json @@ -120,7 +120,7 @@ "scipy": "1.6.0", // Note: these don't have a minimum in setup.py "h5py": "3.1.0", - "ephem": "3.7.6.0", + "ephem": "3.7.7.0", // first version to support py 3.8 "numba": "0.47.0", // first version to support py 3.8 }, // latest versions available