-
-
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
[MRG+1] Insert metadata in docstrings of images in skimage.data.* #2236
Conversation
Current coverage is 90.66% (diff: 100%)@@ master #2236 diff @@
==========================================
Files 304 303 -1
Lines 21435 21773 +338
Methods 0 0
Messages 0 0
Branches 1844 2014 +170
==========================================
+ Hits 19421 19741 +320
- Misses 1661 1669 +8
- Partials 353 363 +10
|
def _install_metadata_doc(): | ||
"Insert metadata to docstrings that return images." | ||
import sys | ||
for name in __all__: |
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 don't think I'm a fan of this approach. What if we want to add new functions? It's up to the contributor to figure out that this global function is messing with their contribution.
Instead, I would suggest a decorator that gets applied to each image function. It's a bit more wordy, but also more self-documenting.
As an alternative, I would make this list explicit, instead of implicitly loading all names.
@@ -259,3 +259,20 @@ def rocket(): | |||
|
|||
""" | |||
return load("rocket.jpg") | |||
|
|||
def _install_metadata_doc(): |
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 don't think we can do this, since it requires loading all images upon import.
Can we just hardcode the meta-data?
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.
ok. Do you have a preferred format? (Just to make it right with a single bullet :) )
8f4868b
to
b4ec449
Compare
function to print metadata.
|
I inserted manually the metadata. I posted a code to double check. |
Looks good. |
Looks like the random travis failures are due to #2237 |
Travis is now happy: merging! |
This PR solves the first item of #989 with the recommendation of @stefanv #993 (comment)
I used a similar function name as in
regionprops
.This screenshot illustrates the result. I'm open to comments, especially on the style we want...
Cc @cdeil