openclimatefix / open-source-quartz-solar-forecast

Open Source Solar Site Level Forecast
MIT License
56 stars 50 forks source link

Add python3.12 #93

Open peterdudfield opened 6 months ago

peterdudfield commented 6 months ago

Detailed Description

Would be good if this ran for python3.12

Possible Implementation

rahul-maurya11b commented 5 months ago

@peterdudfield sir, can i take this one ?

OyewoleRasheed commented 5 months ago

@peterdudfield sir, I want to work on this. I'll start by running the project's examples locally using Python 3.12 to ensure compatibility and identify any potential issues. I will be glad to get the opportunity to work on this project. I'm an Electrical Engineer passionate about climate change and I am currently working with python as I am currently taking a machine learning course in my school and also learning data science with python on World Quant University. This project is something I want to contribute to and also learn more from. Thank you sir

suleman1412 commented 5 months ago

I'd like to tackle this issue. After attempting to run the test in Python 3.12, it appears that there's an issue with compatibility. The test didn't execute as expected due to pv-site-prediction package not being supported in Python 3.12. Any guidance or assistance would be greatly appreciated.

shlok191 commented 5 months ago

@peterdudfield, I think I understand what is going wrong here! :) There are dependencies stemming from pv-site-prediction that are bound to python versions less than 3.12.

I tried to update the dependency versioning in the pyproject.toml, but unfortunately some dependencies' latest packages still do not support 3.12 yet! I've worked quite a bit on CI/CD, and I'd be happy to add 3.12 tests to the CI. It should work eventually when the dependencies catch up, but it might show you some failures in the shorter timespan.

Should I go ahead and add tests for 3.12 to CI?

zakwatts commented 5 months ago

Hi @shlok191! Thanks for pointing this out. You are correct in that currently pv-site-prediction is bound by:

[tool.poetry.dependencies] python = "^3.10,<3.12" which would exclude version 3.12.

Can you find out which of the dependencies dont support 3.12 yet? Before we proceed with adding the 3.12 tests, let's take a step back and review our current dependencies to pinpoint which ones specifically lack support for Python 3.12. :)

shlok191 commented 5 months ago

@zakwatts, absolutely!

It is the pandas-stubs library that does not support python 3.12 yet. There could potentially be more (the dependency check could just be failing at the first dependency error), but from what I see it is this library only.

Here is the official error: pandas-stubs requires Python >=3.8,<3.12, so it will not be satisfied for Python >=3.12,<4.0

I really like what you all are working on, and I would love to help out more! Let me know if there's anything else for me to possibly help out with :)

Clemo97 commented 2 months ago

@zakwatts how did you go about finding what the issue, essentially i'm curious about the techniques you used to identify and isolate the issue to that specific library? Also are you still working on fixing this issue as I just experienced it today and it gave me quite the headache since I just moved to Ubuntu 22.04, which has python 3.12.3 ?

Clemo97 commented 2 months ago

@peterdudfield I think @zakwatts was right in the [pv-site-prediction](https://github.com/openclimatefix/pv-site-predictionl) repo i checked the pyproject.toml file and pandas-stubs = "^1.5.2.221213" is only compatible with python 3.11 version. Hence the error; Screenshot from 2024-07-05 19-13-06

See here for reference https://pypi.org/project/pandas-stubs/1.5.2.221213/ I suggest upgrading pandas-stubs to the latest version pandas-stubs==2.2.2.240603 released on Jun 3 2024.

Check https://pypi.org/project/pandas-stubs/#history

I'll keep checking the other dependencies to see if any are still outdated and not compatible with the latest Python 3.12, since there's alot of them it'll take awhile

zakwatts commented 2 months ago

Hi @Clemo97! Thanks for picking this up. It was a little while ago when I did this, but essentially as i work on the pv-site-predicition model i think I knew that this was likely causing some dependency problems. Thanks for letting us know about the new version of pandas-stubs! When i get the chance i should be able to update this at somepoint and hopefully that should allow us to update Open Quartz to python 3.12. Thanks!

Clemo97 commented 2 months ago

@zakwatts Since the issue exists in pv-site-prediction, I believe the issue should be addressed there. I'll create an issue in that repo and continue working on it, I also found more than one dependency issue apart from pandas-stubs