Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python 3.13 and drop Python 3.9 #157

Open
2 tasks done
tyralla opened this issue Oct 22, 2024 · 3 comments
Open
2 tasks done

Support Python 3.13 and drop Python 3.9 #157

tyralla opened this issue Oct 22, 2024 · 3 comments

Comments

@tyralla
Copy link
Member

tyralla commented Oct 22, 2024

I checked our dependencies, and we still have to wait for suitable NetCDF4 binaries (but they are already in preparation, NetCDF4 issue 1370). Hence, the following to-do list is only preliminary:

@tyralla
Copy link
Member Author

tyralla commented Oct 23, 2024

Proper NetCDF4 wheels are now available. However, we must wait for Python 3.13.1 because of the bug reported here.

@tyralla
Copy link
Member Author

tyralla commented Oct 24, 2024

I hoped that PEP 667 would allow us to manipulate the (optimised) namespaces of functions, too, so that patterns like this became possible:

from hydpy.models.hland_96 import *

simulationstep("1h")
parameterstep("1d")

def add_rconcmodel(main):
    with main.add_rconcmodel_v1("rconc_uh"):
        uh("triangle", tb=0.36728)

add_rconcmodel(model)

The error under Python 3.12 is: NameError: name 'uh' is not defined.

The (current) error under Python 3.13.0 is: AttributeError: 'FrameLocalsProxy' object has no attribute 'pop'.

The latter message will likely change under Python 3.13.1 due to PR 125616.

However, adding and removing names from optimised scopes will still not be supported, so everything will stay as is from the user's perspective. (We might need to adapt HydPy's source code, but I expect at most minor changes.).

@tyralla
Copy link
Member Author

tyralla commented Oct 24, 2024

I completed the above two tasks and a little more refurbishing (with the help of PyUpdater) and pushed everything into the branch feature/python_3.13.

That's it for now. I will wait for Python 3.13.1, which can apparently be expected for December.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant