-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add module docstring to dandiapi.py #756
Conversation
Codecov Report
@@ Coverage Diff @@
## master #756 +/- ##
==========================================
- Coverage 84.85% 84.83% -0.02%
==========================================
Files 59 59
Lines 6021 6027 +6
==========================================
+ Hits 5109 5113 +4
- Misses 912 914 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
dandi/dandiapi.py
Outdated
|
||
.. code:: python | ||
|
||
from operator import attrgetter |
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.
from operator import attrgetter |
since no longer used.
Please make this code snippet/docstring doc tested so we could ensure it stays valid.
With that let's finalize this PR and let's get it merged.
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.
@yarikoptic The code downloads assets. How is that supposed to be safely doctested (to say nothing of how long it could take to run the code)?
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.
d'oh , right. Lets may be comment out the download
line (with a comment to use it if download is desired) and just print metadata? I just feel that having at least majority of the docstring sample tested would be of great benefit long term
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.
@yarikoptic Doctests work by comparing the code's output to the output given in the doctest. Aside from the fact that most Dandiset metadata is multiple lines long even when not formatted, we would have to update the doctest whenever a new version is published.
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.
could we use # doctest:+ELLIPSIS
and have ...
to swallow all output?
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.
@yarikoptic That works, but the doctest adds about 50 seconds to the total test runtime.
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.
that is indeed notable. Could we may be run such a full sweep with doc-tests only on cron (e.g. daily)?
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.
@yarikoptic Done.
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.
Looks good to me. Time to undraft and merge?
Great, Thank you, let's proceed. |
Closes #755.