Repository navigation
Harmonize doctest imports - #8234
Conversation
|
Reviews (1): Last reviewed commit: "Harmonize doctest imports" | Re-trigger Greptile |
| >>> from _skimage2 import data | ||
| >>> from _skimage2.io import ImageCollection | ||
| >>> data_dir = Path(data.__file__).parent |
There was a problem hiding this comment.
I think we expose data_dir in skimage.data's dunder all. Might be easier to use here?
There was a problem hiding this comment.
Yes, good idea, I used that instead.
lagru
left a comment
There was a problem hiding this comment.
Looks like a quick improvement if it helps you address other work.
Though in the past we decided to recommend import skimage as ski (and skimage2 equivalent) and use that in all our documentation ourselves. Probably want to tackle that eventually. So maybe we should make sure that the doctest adapter you are working on, doesn't make that more difficult?
8e1eb59 to
ffac4c4
Compare
|
Reviews (2): Last reviewed commit: "Harmonize doctest imports" | Re-trigger Greptile |
|
Reviews (3): Last reviewed commit: "Add fix for warning on SimpleITK" | Re-trigger Greptile |
Only implicitly use own callable, and `np`, in doctests, import everything else explicitly.
7f74528 to
255904a
Compare
|
Reviews (4): Last reviewed commit: "Add fix for warning on SimpleITK" | Re-trigger Greptile |
|
Planning to merge soon - OK with y'all? (Note extra fix for SimpleITK error on main). |
* origin/main: Harmonize doctest imports (scikit-image#8234)
Only implicitly use own callable, and
np, in doctests, importeverything else explicitly.
This implements the rule that doctests should always explicitly import stuff
that they use, except the function / method being tested, and
np.