-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Remove matplotlib as a core dependency. #3129
Remove matplotlib as a core dependency. #3129
Conversation
Hello @hmaarrfk! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on February 28, 2019 at 04:14 Hours UTC |
This comment has been minimized.
This comment has been minimized.
1b4c9e0
to
cec0783
Compare
Undo some of the merge errors that were introduced in a previous rebase.
95ca24c
to
4043434
Compare
Undo some of the merge errors that were introduced in a previous rebase.
c08a930
to
5ff38ab
Compare
Future me notes: Seems like mac os builds might be failing because of a bug in libpng |
14e7bf4
to
89d892a
Compare
ec0795a
to
3e2247c
Compare
41a6798
to
ab6913a
Compare
5270a78
to
b40aef6
Compare
@@ -6,6 +6,7 @@ sphinx-gallery | |||
sphinx-copybutton | |||
pytest-runner | |||
scikit-learn | |||
matplotlib>=2.0.0,!=3.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about future >3.0.0 it still won't be compatible, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should work, it is just 3.0.0 that is skipped. When 3.0.0 it had a bug, that was fixed in 3.0.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, now I see that there is no support for py2, (matplotlib 3.x droped it also)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for now, we still support installing matplotlib 2.3 + scikit-image 0.15
Hey @hmaarrfk, |
This needs a few core devs to want to take this on at one time. I can update if you want to review. |
@@ -53,3 +61,81 @@ def polygon_area(pr, pc): | |||
pr = np.asarray(pr) | |||
pc = np.asarray(pc) | |||
return 0.5 * np.abs(np.sum((pc[:-1] * pr[1:]) - (pc[1:] * pr[:-1]))) | |||
|
|||
|
|||
def _clip_sutherland_hodgman(rp, cp, rclip, cclip): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this implementation come from? These clipping algorithms are notoriously tricky to get right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote it adapting the code you referred to I believe.
https://github.com/stefanv/supreme/blob/master/supreme/ext/polygon.c#L121
Sad that this PR is not merged 😕. @hmaarrfk do you have bandwidth to work again on it? |
I'm not too sure it made sense to remove the core dependency without a concerted desire from the core devs. To do so, requires effort to move cleanup PRs like this one forward. And follow them up with other maintenance PRs. I tink people can take the implementation of the function I wrote here verbatim. I think it works. I think there remained one function that needed to be rewritten to truely get rid of matplotlib. It remains to answer, why? The scientific Python stack has gotten ALOT easier to install now. So I think that depending on matplotlib is only about saving disk space, and likely loading time in niche applications. I think both of those can be accomplished by lazy loading, which I think there was an interesting PR by stefanv. I do think it is good to reduce dependencies to make things faster to download. I've gotten bitten by 256k modems (or throttled to those speeds) and any python installation process was rather miserable. But I'm not sure it is a common enough usecase for me to devote time on. |
Reducing our dependency may also help the adoption of |
That is very true. If you are willing to help push this through, then I can likely mustard some courage to revive certain PRs. |
I don't think matplotlib is software of unknown pedigree. It is true that we mostly use it for visualization, but it is employed in a few places for splines, polygons, etc. I'd get rid of the Qt dependency and deprecate skimage.viewer, then lazy load matplotlib as necessary (i.e., if you don't use it, it never gets pulled in). |
@stefanv, even if
Do you mean that it will be installed on user machine the first time a function involving it is called? |
This PR supersedes #3129. It: - defines `skimage._shared.has_mpl` flag - uses `skimage._shared.version_requirements.require` decorator on the function using `matplotlib` - Disable `skimage.viewer` default imports if `matplotlib` is not installed - skip tests requiring `matplotlib` when it is not installed. Co-authored-by: Marianne Corvellec <marianne.corvellec@ens-lyon.org> Co-authored-by: Riadh <r.fezzani@vitadx.com>
Issue #2710
Move matplotlib to optional dependency.
Skip tests that can't run without matplotlib
Few questions:
geometry.polygon_clip
requiresmatplotlib path, transforms
. :- Look into updating the celiagg conda recipe so it isn't pinned to numpy 1.12. Ultimately, we decided against this since it seemed like we were just removing matplotliib and replacing it with a different dependency.
- See this PR Update to version 1.0.3 conda-forge/celiagg-feedstock#4 on celiagg's feedstock
- A python implemented of the required algorithm was written to replace the matplotlib exposed algorithm.
Note: This was rebased onto: #3432
Checklist
[It's fine to submit PRs which are a work in progress! But before they are merged, all PRs should provide:]
./doc/examples
(new features only)[For detailed information on these and other aspects see scikit-image contribution guidelines]
References
[If this is a bug-fix or enhancement, it closes issue # ]
[If this is a new feature, it implements the following paper: ]
For reviewers
(Don't remove the checklist below.)
later.
__init__.py
.doc/release/release_dev.rst
.