Skip to content

Api docs patch #7289

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

Merged
merged 5 commits into from
Mar 2, 2023
Merged

Api docs patch #7289

merged 5 commits into from
Mar 2, 2023

Conversation

mslw
Copy link
Contributor

@mslw mslw commented Feb 17, 2023

This PR adds create_sibling_ria, foreach_dataset, export_archive_ora, and shell_completion to the table of contents in the Python module reference, therefore including them in the html documentation.

This required a change to section headings in the create_sibling_ria docstring, because sphinx napoleon extension only allows a set of predefined headings (custom ones can be added, but I thought reformatting makes more sense). I also used the opportunity to change single quotes into double backticks in said docstring, but compared to headings this isn't necessary for the docbuild.

Details in commit messages. Closes #7288

mslw added 4 commits February 17, 2023 16:16
Sphinx's autodoc (more specifically, napoleon extension) only allows a
fixed set of section headers in NumPy style docstrings, and causes an
error, "unexpected section title", when building docs.

This commit introduces a "Notes" section, relegates headers to regular
text, and adds double blank lines before. IMHO this produces a nice
compromise for readability in docstrings, command line help, and
online documentation.
Replaces single quotes with reST double backticks.
@mslw mslw added the semver-documentation Changes only affect the documentation, no impact on version label Feb 17, 2023
@codecov
Copy link

codecov bot commented Feb 17, 2023

Codecov Report

Base: 88.73% // Head: 90.66% // Increases project coverage by +1.93% 🎉

Coverage data is based on head (6674407) compared to base (451d402).
Patch has no changes to coverable lines.

❗ Current head 6674407 differs from pull request most recent head 1507957. Consider uploading reports for the commit 1507957 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##            maint    #7289      +/-   ##
==========================================
+ Coverage   88.73%   90.66%   +1.93%     
==========================================
  Files         326      326              
  Lines       44429    44415      -14     
  Branches     5919     5919              
==========================================
+ Hits        39422    40270     +848     
+ Misses       4992     4130     -862     
  Partials       15       15              
Impacted Files Coverage Δ
datalad/distributed/create_sibling_ria.py 85.79% <ø> (-0.09%) ⬇️
datalad/downloaders/tests/utils.py 92.30% <0.00%> (-7.70%) ⬇️
datalad/distribution/utils.py 94.00% <0.00%> (-6.00%) ⬇️
datalad/tests/test_version.py 82.85% <0.00%> (-2.86%) ⬇️
datalad/support/entrypoints.py 57.89% <0.00%> (-2.64%) ⬇️
datalad/cli/tests/test_formatters.py 97.82% <0.00%> (-2.18%) ⬇️
datalad/support/tests/test_sshrun.py 98.27% <0.00%> (-1.73%) ⬇️
datalad/local/remove.py 95.31% <0.00%> (-1.57%) ⬇️
datalad/interface/utils.py 95.28% <0.00%> (-1.05%) ⬇️
datalad/support/tests/test_cookies.py 86.66% <0.00%> (-0.84%) ⬇️
... and 23 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

api.export_to_figshare
api.no_annex
api.shell_completion
Copy link
Member

Choose a reason for hiding this comment

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

I know that would be much to ask but since it seems to be "common" to forget to include them in modref, a unittest could be added to https://github.com/datalad/datalad/blob/HEAD/datalad/tests/test_api.py#L81 or around to alert when interface is not present in modref.rst if it would find it present?

not sure though if wouldn't interfer with the cases of extensions. so consider as a really weak wishlist

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing out that test, I wasn't aware of it. So the added test would need to parse modref.rst?

With extensions though - if they are listed in interface groups, then I suppose the outcome would depend on what is installed in test environment (which doesn't have to be CI). Although taking a random virtualenv and quickly checking, that might not be the case.

I guess that could be done, question is whether it should be done ;)

Can't use actual ReST subsections in docs without crashing docs
autogeneration unless the headings are declared in Sphinx
configuration - see commit 6956042 for more details (and less
formatting).

Suggested-by: Yaroslav Halchenko <debian@onerussian.com>
@mslw
Copy link
Contributor Author

mslw commented Feb 26, 2023

I don't see myself working on a test that compares the ReST document to the actual API in the coming days due to other backlogs, and since @yarikoptic sees it as "a really weak wishlist", I'd like to propose this PR as is.

Copy link
Member

@adswa adswa left a comment

Choose a reason for hiding this comment

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

This looks good to me

@adswa adswa merged commit ac18e68 into datalad:maint Mar 2, 2023
@yarikoptic-gitmate
Copy link
Collaborator

PR released in 0.18.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-documentation Changes only affect the documentation, no impact on version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A few commands, including create_sibling_ria and foreach_dataset, are missing from python module reference
4 participants