pvlib / pvlib-python

A set of documented functions for simulating the performance of photovoltaic energy systems.
https://pvlib-python.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.2k stars 1k forks source link

Python 3.13 preparation #2201

Open mikofski opened 2 months ago

mikofski commented 2 months ago

Is your feature request related to a problem? Please describe. Final release candidate of Python 3.13 announced. Requests upstream for prep

Describe the solution you'd like As Python 3.13 to test matrix similar to RdTools

Describe alternatives you've considered Put upper bound on Python compatibility

Additional context See Google group discussion on py3.13rc02.

kandersolar commented 2 months ago

@RDaxini or @IoannisSifnaios, any interest in continuous integration (CI) infrastructure management? Adding python 3.13 to the test matrix would be a good way to dip your toes into that world :)

Note that we can't start testing on 3.13 just yet since some of pvlib's dependencies (e.g. h5py) haven't released wheels for it yet. So Step 0 here is just to check in on the dependencies every once in a while. Once those wheels are available, we'll modify the GitHub Actions workflow files to include 3.13. See #1886 for an example of what that looks like.

RDaxini commented 2 months ago

@kandersolar Sure I am interested.

I was reviewing #1886 as advised and I noticed here that although some of the dependencies were unavailable in python 3.12, e.g. numba, this does not seem to have been a problem(?) ---why not?

This is not something with which I have any experience so I might just be missing/misunderstanding something obvious 😅

kandersolar commented 2 months ago

It's a good question! The reason is that some of pvlib's dependencies are required while others are merely optional. "Required" means that pip install pvlib will fail if pip can't locate a suitable installation file for the dependency. "Optional" ones are not required for installation to succeed, but of course some pvlib functionality is not available unless the relevant dependency is installed. Our tests are configured such that tests for that functionality get skipped if the relevant optional dependency isn't installed.

You can check that the dependencies omitted in #1886 are all optional dependencies as defined in pyproject.toml:

https://github.com/pvlib/pvlib-python/blob/a14e95e07173fce14b9a2a7173eb6321bd78059b/pyproject.toml#L13-L20

https://github.com/pvlib/pvlib-python/blob/a14e95e07173fce14b9a2a7173eb6321bd78059b/pyproject.toml#L48-L56

And just to finish the story, we did add those dependencies back in once wheels became available: #1964

IoannisSifnaios commented 2 months ago

@kandersolar is there an easy way of finding which optional dependencies do not work with python 3.13? E.g., if we make a PR, would we get an error about which ones are not compatible? Or do we have to manually check each one of them to see if it is 3.13 compatible or not?

kandersolar commented 2 months ago

Yes a PR would certainly tell you whether the package landscape is sufficiently progressed for us to start using it for pvlib. I suppose there is no harm in opening a PR now, with the expectation that it will remain open for some time waiting for the dependencies to become available. In fact the current roadblock may be whether python 3.13 itself is installable on the CI yet :P

echedey-ls commented 2 months ago

We need to bring back the discussion of solarfactors again https://github.com/pvlib/solarfactors/issues/16 There will certainly be problems with all the code that relies on solarfactors.

IoannisSifnaios commented 2 months ago

Yes a PR would certainly tell you whether the package landscape is sufficiently progressed for us to start using it for pvlib. I suppose there is no harm in opening a PR now, with the expectation that it will remain open for some time waiting for the dependencies to become available. In fact the current roadblock may be whether python 3.13 itself is installable on the CI yet :P

Makes sense! I guess we should at least wait for the official release (1/10/2024)