Change old import convention in the gallery examples#7630
Change old import convention in the gallery examples#7630mkcor merged 10 commits intoscikit-image:mainfrom
Conversation
Old import convention is used in the gallery examples, this PR changes it to new import convention in all the examples on the applications directory Resolves: scikit-image#7454
That automatic check makes sure that the code is formatted properly and also checks for common errors. If you click on the job's "Details" you can see the result. The check fails because the file |
|
fixed in #7631 |
Ah, thank you! This makes sense now, I was confused. I chose this issue since I'm a first time contributor to Scikit-image and now that the development environment is set, I can contribute to more issues. :) |
There was a problem hiding this comment.
Thank you @jgyasu for working on this. It looks like you still missed a few files in the doc/examples/applications/ directory. E.g., plot_coins_segmentation.py.
You can easily find those cases by searching specifically for "skimage." (notice the dot) in the applications/ directory. For example with
grep "skimage." -R doc/examples/applications/
|
| # The following example shows how local auto-level enhances the camara man | ||
| # picture. | ||
|
|
||
| from skimage.filters.rank import autolevel |
There was a problem hiding this comment.
Here and in other places, you typically want to remove a blank line as well (either the one above or the one below) in addition to the import line. Otherwise you end up with an extra blank line.
There was a problem hiding this comment.
Thank you, I will fix it. I contributed to an another open-source project once and it used pre-commit and before committing, it automatically edited out all the style issues. I want to know if there exists any tool like that for Scikit-image?
There was a problem hiding this comment.
Hi @jgyasu,
Yes, "we recommend that you use a pre-commit hook, which runs code checkers and formatters each time you do a git commit" (Development process). It looks like you have installed it, and that it ran successfully, since CI says:
pre-commit.ci - pr — checks completed successfully
|
@jgyasu don't worry about the CI failure, it's unrelated! Looking at the failing workflow, I can see: I'll open an issue. |
|
Also @mkcor is there any issue or feature that I can work on? I want a good understanding of the codebase and I'm ready to work on something even if it takes time |
|
Hi @jgyasu, I have updated your branch with the latest changes in
Thank you for this generous offer! 🙏 Here we have a list of changes we would like to implement (independently of the For example, one goal is to make the default behavior of all our thresholding functions consistent. It's not something that will happen over a quick PR! Also, you'll have to learn how to deprecate a function or some of its parameters: See https://github.com/scikit-image/scikit-image/pull/7225/files for example. I hope the learning curve isn't too steep. That would be a great investment for future contributions, for sure! Thanks again. |
|
The CI failure for That thumbnail is generated from a Plotly figure. Although, from https://pypi.org/project/plotly/, I'm surprised to read that "The kaleido package has no dependencies..." 🤔 |
|
I guess there's a change with Python 3.12, perhaps when specifying a random seed...? The failing test is scikit-image/skimage/graph/tests/test_rag.py Lines 209 to 211 in efe339b and the error only occurs with Python 3.12: "FAILED graph/tests/test_rag.py::test_reproducibility - AssertionError." Locally, for me, passes either on main or this feature branch (I fetched it), but I'm running Python 3.11 precisely. Edit: Nevermind, current CI is green on main and it also runs Python 3.12 (even 3.13), so that can't be it. 😓 |
|
@mkcor I made an issue for what you describe in your comment directly above. It's #7651. |
|
Thanks, @lagru. Ok, I'll approve and merge, since the CI failures are unrelated (and still mysterious). |
|
@jgyasu congrats on getting your first scikit-image contribution merged! 🎉 |
Thank you! After my exams, I hope to contribute more 🙂 |
|
🙏 👏 |

Old import convention is used in the gallery examples, this PR changes it to new import convention in all the examples on the applications directory
Resolves part of #7454.
Description
Checklist
./doc/examplesfor new featuresRelease note
For maintainers and optionally contributors, please refer to the instructions on how to document this PR for the release notes.