-
Notifications
You must be signed in to change notification settings - Fork 257
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
Fix ImportError in plantcv caused by change in skimage.feature function name #998
Conversation
…on name This commit updates the requirements.txt file and replaces the use of the deprecated function name 'greycomatrix' with 'graycomatrix' in `threshold_methods.py`. The change in function name in skimage.feature from version 0.19 caused an ImportError when importing plantcv, which is resolved with this commit.
@fbarbe00 thanks very much for opening this PR and sorry for the delay in response. |
Ugh..Looks like the renaming issues also trickle down past the imports part. Now tests fail on
If you'd prefer, I can dig into their updated parameter names, push commits to this PR, and hopefully resolve those remaining bugs. Thanks again @fbarbe00 for bringing this to our attention. @nfahlgren can we add them as a contributor so tests automatically run next time? Update: https://scikit-image.org/docs/0.20.x/api/skimage.feature.html#peak-local-max vs. https://scikit-image.org/docs/0.18.x/api/skimage.feature.html#peak-local-max |
Thanks a lot for your reply! Is there anything I can still try to help with? |
Btw, this solves Issue #1002 |
Yes @fbarbe00 If you're able to figure out how to get an array-like output from the latest version of |
In skimage>=0.19, the `peak_local_max` function no longer takes the `indices` argument. This adds two lines to compute the indices after getting the local max coordinates.
Hi @HaleySchuhl , I believe my last commit fixes it! I just looked at what the Note that I do not have a deep understanding of what this code actually does, but this does seem to fix this function and work as before. |
Codecov Report
@@ Coverage Diff @@
## main #998 +/- ##
===========================================
- Coverage 100.00% 99.98% -0.02%
===========================================
Files 129 141 +12
Lines 5803 6004 +201
===========================================
+ Hits 5803 6003 +200
- Misses 0 1 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Awesome! Tests seem to pass but now there's an issue in the Python 3.7 build on codecov for some reason? |
I think codecov stopped working with Python 3.7, which was the oldest version we were testing. I bumped up the testing environments to 3.8, 3.9, and 3.10 since 3.11 is out now. |
Currently, when installing plantcv, the following error is raised:
ImportError: cannot import name 'greycomatrix' from 'skimage.feature'
This is because skimage.feature changed their function name from greycomatrix to graycomatrix (see https://stackoverflow.com/questions/67537650/cannot-import-name-graycomatrix-from-skimage-feature ) from version 0.19. This commit changes the requirements.txt file and the function name.