Skip to content
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

Merged
merged 10 commits into from
Sep 1, 2021
Merged

Add module docstring to dandiapi.py #756

merged 10 commits into from
Sep 1, 2021

Conversation

jwodder
Copy link
Member

@jwodder jwodder commented Aug 25, 2021

Closes #755.

@jwodder jwodder added the documentation Changes only affect the documentation label Aug 25, 2021
dandi/dandiapi.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Aug 25, 2021

Codecov Report

Merging #756 (a1e3910) into master (78d81de) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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     
Flag Coverage Δ
unittests 84.83% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
dandi/dandiapi.py 92.64% <ø> (-0.36%) ⬇️
dandi/tests/fixtures.py 97.16% <100.00%> (ø)
dandi/tests/test_dandiarchive.py 100.00% <0.00%> (ø)
dandi/pynwb_utils.py 82.45% <0.00%> (+0.10%) ⬆️
dandi/dandiarchive.py 83.75% <0.00%> (+0.16%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 78d81de...a1e3910. Read the comment docs.

dandi/dandiapi.py Outdated Show resolved Hide resolved
dandi/dandiapi.py Outdated Show resolved Hide resolved
dandi/dandiapi.py Outdated Show resolved Hide resolved
dandi/dandiapi.py Outdated Show resolved Hide resolved

.. code:: python

from operator import attrgetter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Member Author

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)?

Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member Author

@jwodder jwodder Aug 31, 2021

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.

Copy link
Member

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)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yarikoptic Done.

Copy link
Member

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?

@jwodder jwodder marked this pull request as ready for review August 31, 2021 21:04
@yarikoptic
Copy link
Member

Great, Thank you, let's proceed.

@yarikoptic yarikoptic merged commit 49683fe into master Sep 1, 2021
@yarikoptic yarikoptic deleted the gh-755 branch September 1, 2021 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Changes only affect the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

provide main modules docstring describing their purpose, giving some example
2 participants