Skip to content

Commit 3caaa1d

Browse files
committed
Merge remote-tracking branch 'upstream/main' into freq_M_to_ME
2 parents cbf9224 + c18c796 commit 3caaa1d

File tree

188 files changed

+37359
-35986
lines changed

Some content is hidden

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

188 files changed

+37359
-35986
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- Thank you for your contribution! The following items must be addressed before the code can be merged. Please don't hesitate to ask for help if you're unsure of how to accomplish any of the items. Feel free to remove checklist items that are not relevant to your change. -->
22

33
- [ ] Closes #xxxx
4-
- [ ] I am familiar with the [contributing guidelines](https://pvlib-python.readthedocs.io/en/latest/contributing.html)
4+
- [ ] I am familiar with the [contributing guidelines](https://pvlib-python.readthedocs.io/en/latest/contributing/index.html)
55
- [ ] Tests added
66
- [ ] Updates entries in [`docs/sphinx/source/reference`](https://github.com/pvlib/pvlib-python/blob/main/docs/sphinx/source/reference) for API changes.
77
- [ ] 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` ``).

.github/workflows/asv_check.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,7 @@ jobs:
2626
python-version: '3.9'
2727

2828
- name: Install asv
29-
run: pip install asv==0.4.2
30-
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
29+
run: pip install asv==0.6.4
4230

4331
- name: Run asv benchmarks
4432
run: |

.github/workflows/publish.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,21 @@ jobs:
3333
- name: Build packages
3434
run: python -m build
3535

36+
- name: List distribution file sizes
37+
run: du -h dist/*
38+
3639
- name: Check metadata verification
3740
run: python -m twine check --strict dist/*
3841

42+
- name: Ensure that the wheel installs successfully
43+
run: |
44+
mkdir ./tmp
45+
pip install $(find dist -type f -name "*.whl") --target=./tmp
46+
47+
- name: List installed file sizes
48+
run: du -h pvlib
49+
working-directory: ./tmp
50+
3951
# only publish distribution to PyPI for tagged commits
4052
- name: Publish distribution to PyPI
4153
if: startsWith(github.ref, 'refs/tags/v')

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
strategy:
5757
fail-fast: false # don't cancel other matrix jobs when one fails
5858
matrix:
59-
python-version: [3.9, "3.10", "3.11", "3.12"]
59+
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
6060
suffix: [''] # the alternative to "-min"
6161
include:
6262
- python-version: 3.9
@@ -100,7 +100,7 @@ jobs:
100100
SOLARANYWHERE_API_KEY: ${{ secrets.SOLARANYWHERE_API_KEY }}
101101
BSRN_FTP_USERNAME: ${{ secrets.BSRN_FTP_USERNAME }}
102102
BSRN_FTP_PASSWORD: ${{ secrets.BSRN_FTP_PASSWORD }}
103-
run: pytest pvlib/tests/iotools --cov=./ --cov-report=xml --remote-data
103+
run: pytest tests/iotools --cov=./ --cov-report=xml --remote-data
104104

105105
- name: Upload coverage to Codecov
106106
if: matrix.python-version == 3.9 && matrix.suffix == ''

.github/workflows/pytest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
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.9, "3.10", "3.11", "3.12"]
15+
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
1616
environment-type: [conda, bare]
1717
suffix: [''] # placeholder as an alternative to "-min"
1818
include:
@@ -79,7 +79,7 @@ jobs:
7979
shell: bash -l {0} # necessary for conda env to be active
8080
run: |
8181
# ignore iotools; those tests are run in a separate workflow
82-
pytest pvlib --cov=./ --cov-report=xml --ignore=pvlib/tests/iotools
82+
pytest tests --cov=./ --cov-report=xml --ignore=tests/iotools
8383
8484
- name: Upload coverage to Codecov
8585
if: matrix.python-version == 3.9 && matrix.suffix == '' && matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda'
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Update Top Ranked Issues
2+
3+
on:
4+
schedule:
5+
# Runs every day at 00:00 AM UTC
6+
- cron: '0 0 * * *'
7+
8+
jobs:
9+
run-script:
10+
runs-on: ubuntu-latest
11+
12+
# Run only if the repository is pvlib/pvlib-python
13+
if: ${{ github.repository == 'pvlib/pvlib-python' }}
14+
15+
env:
16+
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
18+
steps:
19+
- name: Check out the repository
20+
uses: actions/checkout@v4 # This ensures the repository code is available
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.12"
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install PyGithub
31+
32+
- name: Run update_top_ranking_issues.py
33+
run: |
34+
python ./scripts/update_top_ranking_issues.py

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ coverage.xml
8181

8282

8383
# Datafiles
84-
*.csv
85-
# Ignore some csv
86-
!pvlib/data/*.csv
84+
# Do not exclude data directories
85+
!pvlib/data/**
86+
!tests/data/**
8787

8888
# vi
8989
*.swp

ci/requirements-py3.12.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ dependencies:
2525
- statsmodels
2626
- pip:
2727
- nrel-pysam>=2.0
28-
# - solarfactors # required shapely<2 isn't available for 3.12
28+
- solarfactors

ci/requirements-py3.13.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: test_env
2+
channels:
3+
- defaults
4+
- conda-forge
5+
dependencies:
6+
- coveralls
7+
- cython
8+
- ephem
9+
- h5py
10+
- numba
11+
- numpy >= 1.17.3
12+
- pandas >= 1.3.0
13+
- pip
14+
- pytest
15+
- pytest-cov
16+
- pytest-mock
17+
- requests-mock
18+
- pytest-timeout
19+
- pytest-rerunfailures
20+
- conda-forge::pytest-remotedata # version in default channel is old
21+
- python=3.13
22+
- pytz
23+
- requests
24+
- scipy >= 1.6.0
25+
- statsmodels
26+
- pip:
27+
- nrel-pysam>=2.0
28+
- solarfactors

codecov.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ flags:
1414
core:
1515
paths:
1616
- pvlib/
17+
- tests/
1718
- '!pvlib/iotools/'
18-
- '!pvlib/tests/iotools/'
19+
- '!tests/iotools/'
1920
carryforward: false
2021

2122
remote-data:
2223
paths:
2324
- pvlib/iotools/
24-
- pvlib/tests/iotools
25+
- tests/iotools
2526
carryforward: true # if not run, use coverage from previous commit
2627

2728

@@ -47,15 +48,15 @@ coverage:
4748
tests-core:
4849
target: 95%
4950
paths:
50-
- 'pvlib/tests/.*'
51-
- '!pvlib/tests/iotools/.*'
51+
- 'tests/.*'
52+
- '!tests/iotools/.*'
5253
flags:
5354
- core
5455

5556
tests-remote-data:
5657
target: 95%
5758
paths:
58-
- 'pvlib/tests/iotools/.*'
59+
- 'tests/iotools/.*'
5960
flags:
6061
- remote-data
6162

docs/examples/shading/plot_martinez_shade_loss.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
import pandas as pd
4848
import numpy as np
4949
import matplotlib.pyplot as plt
50-
from matplotlib.dates import ConciseDateFormatter
50+
from matplotlib.dates import DateFormatter
5151

5252
pitch = 4 # meters
5353
width = 1.5 # meters
@@ -235,10 +235,6 @@
235235
ax1.plot(times, shade_losses, label=k, linestyle=linestyle)
236236
ax1.legend(loc="upper center")
237237
ax1.grid()
238-
ax1.set_xlabel("Time")
239-
ax1.xaxis.set_major_formatter(
240-
ConciseDateFormatter("%H:%M", tz="Europe/Madrid")
241-
)
242238
ax1.set_ylabel(r"$P_{out}$ losses")
243239
ax1.set_title("Per module")
244240

@@ -248,9 +244,7 @@
248244
ax2.legend(loc="upper center")
249245
ax2.grid()
250246
ax2.set_xlabel("Time")
251-
ax2.xaxis.set_major_formatter(
252-
ConciseDateFormatter("%H:%M", tz="Europe/Madrid")
253-
)
247+
ax2.xaxis.set_major_formatter(DateFormatter("%H:%M", tz="Europe/Madrid"))
254248
ax2.set_ylabel(r"$P_{out}$ losses")
255249
ax2.set_title("Per row")
256250
fig.tight_layout()
Loading
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* Overrides for sphinx-hoverxref since it does not support a native dark theme, see */
2+
/* https://github.com/readthedocs/sphinx-hoverxref/issues/231 */
3+
/* Inspired by https://github.com/pybamm-team/PyBaMM/pull/3083 */
4+
5+
/* These will ensure that the tooltip inherits the pydata-sphinx-theme colours */
6+
7+
.tooltipster-sidetip.tooltipster-shadow.tooltipster-shadow-custom .tooltipster-content {
8+
background-color: var(--pst-color-background) !important;
9+
color: var(--pst-color-text-base) !important;
10+
}

docs/sphinx/source/conf.py

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,30 @@
5656
'sphinx_gallery.gen_gallery',
5757
'sphinx_toggleprompt',
5858
'sphinx_favicon',
59+
'hoverxref.extension',
5960
]
6061

6162
mathjax3_config = {'chtml': {'displayAlign': 'left',
6263
'displayIndent': '2em'}}
6364

65+
# Example configuration for intersphinx: refer to the Python standard library.
66+
intersphinx_mapping = {
67+
'python': ('https://docs.python.org/3/', None),
68+
'numpy': ('https://numpy.org/doc/stable/', None),
69+
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None),
70+
'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None),
71+
'matplotlib': ('https://matplotlib.org/stable', None),
72+
}
73+
74+
# Enable hover tooltips
75+
hoverxref_auto_ref = True
76+
hoverxref_roles = [
77+
"class", "meth", "func", "ref", "term", "obj", "mod", "data"
78+
]
79+
hoverxref_role_types = dict.fromkeys(hoverxref_roles, "tooltip")
80+
hoverxref_domains = ["py"]
81+
hoverxref_intersphinx = list(intersphinx_mapping.keys())
82+
6483
napoleon_use_rtype = False # group rtype on same line together with return
6584

6685
# Add any paths that contain templates here, relative to this directory.
@@ -263,6 +282,8 @@ def setup(app):
263282
app.add_css_file("reference_format.css")
264283
# Add a warning banner at the top of the page if viewing the "latest" docs
265284
app.add_js_file("version-alert.js")
285+
# Match the color theme of tooltips to PyData Sphinx Theme light/dark mode
286+
app.add_css_file("tooltipster_color_theming.css")
266287

267288
# -- Options for LaTeX output ---------------------------------------------
268289

@@ -357,15 +378,6 @@ def setup(app):
357378
# If true, do not generate a @detailmenu in the "Top" node's menu.
358379
# texinfo_no_detailmenu = False
359380

360-
# Example configuration for intersphinx: refer to the Python standard library.
361-
intersphinx_mapping = {
362-
'python': ('https://docs.python.org/3/', None),
363-
'numpy': ('https://numpy.org/doc/stable/', None),
364-
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None),
365-
'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None),
366-
'matplotlib': ('https://matplotlib.org/stable', None),
367-
}
368-
369381
ipython_warning_is_error = False
370382

371383
# suppress "WARNING: Footnote [1] is not referenced." messages

docs/sphinx/source/contributing/how_to_contribute_new_code.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,7 @@ We strongly recommend using virtual environments for development.
153153
Virtual environments make it easier to switch between different
154154
versions of software. This `scientific-python.org guide
155155
<https://learn.scientific-python.org/development/tutorials/dev-environment/>`_
156-
is a good reference for virtual environments. The pvlib-python `installation
157-
user guide <https://pvlib-python.readthedocs.io/en/stable/user_guide/
158-
installation.html#set-up-a-virtual-environment>`_ also provides instructions on
156+
is a good reference for virtual environments. The pvlib-python
157+
:ref:`installation guide <setupenvironment>` also provides instructions on
159158
setting up a virtual environment. If this is your first pull request, don't
160159
worry about using a virtual environment.

docs/sphinx/source/contributing/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _contributing:
2+
13
============
24
Contributing
35
============

0 commit comments

Comments
 (0)