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 for python 3.13 #23

Open
csoneson opened this issue Oct 12, 2024 · 3 comments
Open

support for python 3.13 #23

csoneson opened this issue Oct 12, 2024 · 3 comments

Comments

@csoneson
Copy link
Collaborator

Python 3.13 was just released - I made a branch (py313) to add this to the tested versions. At the moment, the tests fail - seems to be an issue with scikit-image/regionprops.

@mbstadler
Copy link
Collaborator

Thanks for identifying this issue - I can reproduce it locally. I guess we'll give it a bit of time to see if scikit-image/regionprops fixes this.

@csoneson
Copy link
Collaborator Author

Minimal example to trigger the error:

conda environment:

conda create -n skim_313 python=3.13
conda activate skim_313
pip install numpy scikit-image

This installs numpy 2.1.2, scikit-image 0.24.0. The following code:

import numpy as np
import skimage.measure as skim
msk = np.random.randint(0, 16, size=(4, 5))
props = skim.regionprops(msk)

gives the error:

Traceback (most recent call last):
  File "<python-input-1>", line 2, in <module>
    props = skim.regionprops(msk)
            ^^^^^^^^^^^^^^^^
  File ".../envs/skim_313/lib/python3.13/site-packages/lazy_loader/__init__.py", line 82, in __getattr__
    submod = importlib.import_module(submod_path)
  File ".../envs/skim_313/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1022, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File ".../envs/skim_313/lib/python3.13/site-packages/skimage/measure/_regionprops.py", line 1426, in <module>
    _install_properties_docs()
    ~~~~~~~~~~~~~~~~~~~~~~~~^^
  File ".../envs/skim_313/lib/python3.13/site-packages/skimage/measure/_regionprops.py", line 1421, in _install_properties_docs
    getattr(RegionProperties, p).__doc__ = prop_doc[p]
                                           ~~~~~~~~^^^
KeyError: 'area_bbox'

With python 3.12.7 (everything else the same, including numpy and scikit-image versions), the error is not triggered.

@csoneson
Copy link
Collaborator Author

And in fact, if I install the scikit-image-0.25.0rc2.dev0 release candidate from GitHub, the error disappears 🎉.

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

No branches or pull requests

2 participants