Skip to content

Commit 7183b0d

Browse files
authored
Merge pull request #5 from AdamRJensen/main
Main
2 parents 483db92 + b533057 commit 7183b0d

File tree

299 files changed

+121869
-89380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

299 files changed

+121869
-89380
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
- [ ] Closes #xxxx
44
- [ ] I am familiar with the [contributing guidelines](https://pvlib-python.readthedocs.io/en/latest/contributing.html)
55
- [ ] Tests added
6-
- [ ] Updates entries in [`docs/sphinx/source/reference`](https://github.com/pvlib/pvlib-python/blob/master/docs/sphinx/source/reference) for API changes.
7-
- [ ] Adds description and name entries in the appropriate "what's new" file in [`docs/sphinx/source/whatsnew`](https://github.com/pvlib/pvlib-python/tree/master/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` ``).
6+
- [ ] Updates entries in [`docs/sphinx/source/reference`](https://github.com/pvlib/pvlib-python/blob/main/docs/sphinx/source/reference) for API changes.
7+
- [ ] Adds description and name entries in the appropriate "what's new" file in [`docs/sphinx/source/whatsnew`](https://github.com/pvlib/pvlib-python/tree/main/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` ``).
88
- [ ] New code is fully documented. Includes [numpydoc](https://numpydoc.readthedocs.io/en/latest/format.html) compliant docstrings, examples, and comments where necessary.
99
- [ ] Pull request is nearly complete and ready for detailed review.
1010
- [ ] Maintainer: Appropriate GitHub Labels (including `remote-data`) and Milestone are assigned to the Pull Request and linked Issue.

.github/workflows/asv_check.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,47 @@
11
name: asv
22

33
# CI ASV CHECK is aimed to verify that the benchmarks execute without error.
4-
on: [pull_request, push]
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
510

611
jobs:
7-
quick:
12+
quick-benchmarks:
813
runs-on: ubuntu-latest
914
defaults:
1015
run:
1116
shell: bash -el {0}
1217

1318
steps:
14-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
1520
with:
1621
fetch-depth: 0
1722

1823
- name: Install Python
19-
uses: actions/setup-python@v3
24+
uses: actions/setup-python@v5
2025
with:
21-
python-version: '3.9.7'
26+
python-version: '3.9'
2227

2328
- name: Install asv
2429
run: pip install asv==0.4.2
2530

31+
# asv 0.4.2 (and more recent versions as well) creates conda envs
32+
# using the --force option, which was removed in conda 24.3.
33+
# Since ubuntu-latest now comes with conda 24.3 pre-installed,
34+
# using the system's conda will result in error.
35+
# To prevent that, we install an older version.
36+
# TODO: remove this when we eventually upgrade our asv version.
37+
# https://github.com/airspeed-velocity/asv/issues/1396
38+
- name: Install Conda
39+
uses: conda-incubator/setup-miniconda@v3
40+
with:
41+
conda-version: 24.1.2
42+
2643
- name: Run asv benchmarks
2744
run: |
2845
cd benchmarks
2946
asv machine --yes
30-
asv run HEAD^! --quick --dry-run --show-stderr | sed "/failed$/ s/^/##[error]/" | tee benchmarks.log
31-
if grep "failed" benchmarks.log > /dev/null ; then
32-
exit 1
33-
fi
34-
47+
asv run HEAD^! --quick --dry-run --show-stderr
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "flake8-linter-error",
5+
"severity": "error",
6+
"pattern": [
7+
{
8+
"regexp": "^([^:]+):(\\d+):(\\d+):\\s+([EWCNF]\\d+\\s+.+)$",
9+
"file": 1,
10+
"line": 2,
11+
"column": 3,
12+
"message": 4
13+
}
14+
]
15+
}
16+
]
17+
}

.github/workflows/flake8.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Python Flake8 Linter
2+
on:
3+
pull_request:
4+
jobs:
5+
flake8-linter:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout source
9+
uses: actions/checkout@v4
10+
- name: Install Python 3.11
11+
uses: actions/setup-python@v5
12+
with:
13+
python-version: '3.11'
14+
- name: Install Flake8 5.0.4 linter
15+
run: pip install flake8==5.0.4 # use this version for --diff option
16+
- name: Setup Flake8 output matcher for PR annotations
17+
run: echo '::add-matcher::.github/workflows/flake8-linter-matcher.json'
18+
- name: Fetch pull request target branch
19+
run: |
20+
git remote add upstream https://github.com/pvlib/pvlib-python.git
21+
git fetch upstream $GITHUB_BASE_REF
22+
- name: Run Flake8 linter
23+
run: git diff upstream/$GITHUB_BASE_REF HEAD -- "*.py" | flake8
24+
--exclude pvlib/version.py
25+
--ignore E201,E241,E226,W503,W504
26+
--max-line-length 79
27+
--diff

.github/workflows/publish.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
push:
66
branches:
7-
- master
7+
- main
88
tags:
99
- "v*"
1010

@@ -15,27 +15,31 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
# fetch all commits and tags so versioneer works
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1919
with:
2020
fetch-depth: 0
2121

2222
- name: Set up Python
23-
uses: actions/setup-python@v2
23+
uses: actions/setup-python@v5
2424
with:
25-
python-version: 3.8
25+
python-version: 3.9
2626

2727
- name: Install build tools
2828
run: |
2929
python -m pip install --upgrade pip
3030
python -m pip install build
31+
python -m pip install twine
3132
3233
- name: Build packages
3334
run: python -m build
3435

36+
- name: Check metadata verification
37+
run: python -m twine check --strict dist/*
38+
3539
# only publish distribution to PyPI for tagged commits
3640
- name: Publish distribution to PyPI
3741
if: startsWith(github.ref, 'refs/tags/v')
3842
uses: pypa/gh-action-pypi-publish@release/v1
3943
with:
4044
user: __token__
41-
password: ${{ secrets.pypi_password }}
45+
password: ${{ secrets.pypi_password }}

.github/workflows/pytest-remote-data.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# A secondary test job that only runs the iotools tests if explicitly requested
2-
# (for pull requests) or on a push to the master branch.
2+
# (for pull requests) or on a push to the main branch.
33
# Because the iotools tests require GitHub secrets, we need to be careful about
44
# malicious PRs accessing the secrets and exposing them externally.
55
#
@@ -47,36 +47,36 @@ on:
4747
pull_request_target:
4848
push:
4949
branches:
50-
- master
50+
- main
5151

5252
jobs:
5353
test:
5454

5555
strategy:
5656
fail-fast: false # don't cancel other matrix jobs when one fails
5757
matrix:
58-
python-version: [3.7, 3.8, 3.9, "3.10"]
58+
python-version: [3.9, "3.10", "3.11", "3.12"]
5959
suffix: [''] # the alternative to "-min"
6060
include:
61-
- python-version: 3.7
61+
- python-version: 3.9
6262
suffix: -min
6363

6464
runs-on: ubuntu-latest
6565
if: (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'remote-data')) || (github.event_name == 'push')
6666

6767
steps:
68-
- uses: actions/checkout@v3
68+
- uses: actions/checkout@v4
6969
if: github.event_name == 'pull_request_target'
70-
# pull_request_target runs in the context of the target branch (pvlib/master),
70+
# pull_request_target runs in the context of the target branch (pvlib/main),
7171
# but what we need is the hypothetical merge commit from the PR:
7272
with:
7373
ref: "refs/pull/${{ github.event.number }}/merge"
7474

75-
- uses: actions/checkout@v2
75+
- uses: actions/checkout@v4
7676
if: github.event_name == 'push'
7777

7878
- name: Set up conda environment
79-
uses: conda-incubator/setup-miniconda@v2
79+
uses: conda-incubator/setup-miniconda@v3
8080
with:
8181
activate-environment: test_env
8282
environment-file: ${{ env.REQUIREMENTS }}
@@ -99,12 +99,14 @@ jobs:
9999
SOLARANYWHERE_API_KEY: ${{ secrets.SOLARANYWHERE_API_KEY }}
100100
BSRN_FTP_USERNAME: ${{ secrets.BSRN_FTP_USERNAME }}
101101
BSRN_FTP_PASSWORD: ${{ secrets.BSRN_FTP_PASSWORD }}
102-
run: pytest pvlib/tests/iotools pvlib/tests/test_forecast.py --cov=./ --cov-report=xml --remote-data
102+
run: pytest pvlib/tests/iotools --cov=./ --cov-report=xml --remote-data
103103

104104
- name: Upload coverage to Codecov
105-
if: matrix.python-version == 3.7 && matrix.suffix == ''
106-
uses: codecov/codecov-action@v2
105+
if: matrix.python-version == 3.9 && matrix.suffix == ''
106+
uses: codecov/codecov-action@v4
107107
with:
108108
fail_ci_if_error: true
109109
verbose: true
110110
flags: remote-data # flags are configured in codecov.yml
111+
env:
112+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/pytest.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ on:
44
pull_request:
55
push:
66
branches:
7-
- master
7+
- main
88

99
jobs:
1010
test:
1111
strategy:
1212
fail-fast: false # don't cancel other matrix jobs when one fails
1313
matrix:
1414
os: [ubuntu-latest, macos-latest, windows-latest]
15-
python-version: [3.7, 3.8, 3.9, "3.10"]
15+
python-version: [3.9, "3.10", "3.11", "3.12"]
1616
environment-type: [conda, bare]
1717
suffix: [''] # placeholder as an alternative to "-min"
1818
include:
1919
- os: ubuntu-latest
20-
python-version: 3.7
20+
python-version: 3.9
2121
environment-type: conda
2222
suffix: -min
2323
exclude:
@@ -31,7 +31,7 @@ jobs:
3131
steps:
3232
# We check out only a limited depth and then pull tags to save time
3333
- name: Checkout source
34-
uses: actions/checkout@v3
34+
uses: actions/checkout@v4
3535
with:
3636
fetch-depth: 100
3737

@@ -40,12 +40,14 @@ jobs:
4040

4141
- name: Install Conda environment with Micromamba
4242
if: matrix.environment-type == 'conda'
43-
uses: mamba-org/provision-with-micromamba@v12
43+
uses: mamba-org/setup-micromamba@v1
4444
with:
4545
environment-file: ${{ env.REQUIREMENTS }}
4646
cache-downloads: true
47-
extra-specs: |
47+
create-args: >-
4848
python=${{ matrix.python-version }}
49+
condarc: |
50+
channel-priority: flexible
4951
env:
5052
# build requirement filename. First replacement is for the python
5153
# version, second is to add "-min" if needed
@@ -58,7 +60,7 @@ jobs:
5860

5961
- name: Install bare Python ${{ matrix.python-version }}${{ matrix.suffix }}
6062
if: matrix.environment-type == 'bare'
61-
uses: actions/setup-python@v1
63+
uses: actions/setup-python@v5
6264
with:
6365
python-version: ${{ matrix.python-version }}
6466

@@ -76,13 +78,15 @@ jobs:
7678
- name: Run tests
7779
shell: bash -l {0} # necessary for conda env to be active
7880
run: |
79-
# ignore iotools & forecast; those tests are run in a separate workflow
80-
pytest pvlib --cov=./ --cov-report=xml --ignore=pvlib/tests/iotools --ignore=pvlib/tests/test_forecast.py
81+
# ignore iotools; those tests are run in a separate workflow
82+
pytest pvlib --cov=./ --cov-report=xml --ignore=pvlib/tests/iotools
8183
8284
- name: Upload coverage to Codecov
83-
if: matrix.python-version == 3.7 && matrix.suffix == '' && matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda'
84-
uses: codecov/codecov-action@v2
85+
if: matrix.python-version == 3.9 && matrix.suffix == '' && matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda'
86+
uses: codecov/codecov-action@v4
8587
with:
8688
fail_ci_if_error: true
8789
verbose: true
8890
flags: core # flags are configured in codecov.yml
91+
env:
92+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: top_ranked_issues
2+
3+
on:
4+
pull_request: # for testings purposes, should be removed
5+
schedule:
6+
# Runs every day at 3:00 AM UTC
7+
- cron: '0 3 * * *'
8+
9+
jobs:
10+
run-script:
11+
runs-on: ubuntu-latest
12+
13+
# Define GitHub access token
14+
env:
15+
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
17+
18+
steps:
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.12"
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install github
28+
29+
# Run a sample script
30+
- name: Run Script
31+
run: |
32+
python ./scripts/update_top_ranking_issues.py

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ pvlib/spa_c_files/spa_tester.c
4040

4141
# generated documentation
4242
docs/sphinx/source/reference/generated
43+
docs/sphinx/source/reference/*/generated
4344
docs/sphinx/source/savefig
4445
docs/sphinx/source/gallery
46+
docs/sphinx/source/sg_execution_times.rst
4547

4648
# Installer logs
4749
pip-log.txt

.lgtm.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

.stickler.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)