René's URL Explorer Experiment


Title: Consistent Documentation Guide for Docstrings · Issue #9786 · matplotlib/matplotlib · GitHub

Open Graph Title: Consistent Documentation Guide for Docstrings · Issue #9786 · matplotlib/matplotlib

X Title: Consistent Documentation Guide for Docstrings · Issue #9786 · matplotlib/matplotlib

Description: Bug report Summary The documentation guide contains a section about docstrings. Unfortunately, in my attempt to add / improve some docstrings I found it largely deficient. This issue collects the problems I encounted and may serve as a s...

Open Graph Description: Bug report Summary The documentation guide contains a section about docstrings. Unfortunately, in my attempt to add / improve some docstrings I found it largely deficient. This issue collects the p...

X Description: Bug report Summary The documentation guide contains a section about docstrings. Unfortunately, in my attempt to add / improve some docstrings I found it largely deficient. This issue collects the p...

Opengraph URL: https://github.com/matplotlib/matplotlib/issues/9786

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Consistent Documentation Guide for Docstrings","articleBody":"### Bug report\r\n\r\n**Summary**\r\n\r\nThe [documentation guide](http://matplotlib.org/devdocs/devel/documenting_mpl.html#documenting-matplotlib) contains a section about docstrings. Unfortunately, in my attempt to add / improve some docstrings I found it largely deficient.\r\n\r\nThis issue collects the problems I encounted and may serve as a starting point to improve the API docs.\r\n\r\n**Motivation**\r\n\r\nA good documentation is essentially for the usability of a library. Even more so, for a large library with many options and making heavy use of `*args` and `**kwargs`.\r\n\r\nTo get improvements here, there has to be a *consistent and easily understandable style guide*. Otherwise, contributors will not know or bother.\r\n\r\n**Issues**\r\n\r\n1. **Multiple sources**\r\n\r\n* the  [documentation guide](http://matplotlib.org/devdocs/devel/documenting_mpl.html#documenting-matplotlib)\r\n* [Numpy: How to document](https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt)\r\n* The pending #9513 was pointed out to me as an additional source, however I don't think it says anything about docstrings.\r\n* There are some rules discussed or decided in issues, e.g. #8079 on quotes, #7535,  #6924 on Other Parameters\r\n\r\n- [ ] Include all information in the [docstrings section](http://matplotlib.org/devdocs/devel/documenting_mpl.html#docstrings), reference numpydoc docmentation.\r\n\r\n2. **Outdated directions**\r\n\r\nThe [docstrings section](http://matplotlib.org/devdocs/devel/documenting_mpl.html#docstrings) is outdated and thus misleading.\r\n\r\n\u003e In addition to the “narrative” documentation described above, matplotlib also defines its API reference documentation in docstrings. For the most part, these are standard Python docstrings, but matplotlib also includes some features to better support documenting getters and setters.\r\n\r\nbetter:\r\n\r\n\u003e In addition to the “narrative” documentation described above, the API reference documentation is generated from docstrings in the code. Generally, matplotlib uses numpy style docstrings [link]. To further enhance the documentation we have augmented numpy style by some additional conventions and features.\r\n\u003e \r\n\u003e Additional Conventions:\r\n\u003e \r\n\u003e Additional Features: [existing stuff here]\r\n\r\n- [ ] Remove outdated stuff. Add placeholders and notes if there are some known gaps.\r\n\r\n3. **Additional Conventions**\r\n\r\nnumpydoc does not fully cover all aspects of docstrings. Some should be clarified on the project level.\r\n\r\n- Handling of `*args` and `**kwargs`: Should they be Parameters, Other Parameters or something else?\r\n\r\n- Handling of long lists of value choices:\r\n\r\n[See here](https://github.com/matplotlib/matplotlib/pull/9777#pullrequestreview-76296627):\r\n```\r\nprojection :\r\n            ['aitoff' | 'hammer' | 'lambert' | 'mollweide' | \\\r\n'polar' | 'rectilinear'], optional\r\n```\r\n\r\n- When to use *abc*, `abc`, 'abc', \"abc\", ``abc``. In particular also usage of double or single quotes in the docs (even if it's: Do as you like but don't change existing stuff). Indicate if these decisions deviate intentionally from other sources you link (e.g. [numpy](https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt): \"Variable, module, function, and class names should be written between single back-ticks (`numpy`)\", vs [Formatting](http://matplotlib.org/devdocs/devel/documenting_mpl.html#formatting): \"Function arguments and keywords should be referred to using the emphasis role.\"\r\n\r\n- When to cross reference and when not  \"Types don't need to be marked up.\" vs \"Sometimes sphinx doesn't automatically put in links with out the markup though.\" [See here](https://github.com/matplotlib/matplotlib/pull/9777#pullrequestreview-76296627) Also if sphinx has a bug that return values are not always cross-referenced, mention that and your policy (Either keep plain types, it will be fine once sphinx is fixed. Or add reference now, we can strip it later).\r\n\r\n- Usage of call signature: Some methods have this, others not.\r\n\r\n~~~\r\n    Call signature::\r\n\r\n      text(x, y, s, fontdict=None, **kwargs)\r\n~~~\r\n\r\n4. **Migration of documentation**\r\n\r\n- [ ] State that there's still a mixture of old and new styles and that the migration is ongoing.\r\n- [ ] List deprecated conventions and how to replace them.\r\n\r\n5. **Examples**\r\n\r\n- [ ] Add examples in the above parts as much as possible. They are more instructure than lengthy texts.\r\n- [ ] Link to parts of code with good documentation, from which one can learn.\r\n\r\n\r\n","author":{"url":"https://github.com/timhoffm","@type":"Person","name":"timhoffm"},"datePublished":"2017-11-14T23:35:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/9786/matplotlib/issues/9786"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:8aece0fa-f409-89fe-cb89-1841409e4dbd
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id97D8:191DCC:DB5FDE:121D11E:6A532A6D
html-safe-nonce1c717df23cb26ee9a301f18d32cd861e46be7a90e0fb2d77752ce4ea7ff331f1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5N0Q4OjE5MURDQzpEQjVGREU6MTIxRDExRTo2QTUzMkE2RCIsInZpc2l0b3JfaWQiOiI1MjAxMjg1ODU5MTU3MTU4NTA5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac7e5ab9046257cc026372baac4e7c6a0e9f730807e57b21ae94ef964b0678b8a3
hovercard-subject-tagissue:273982408
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/9786/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f4dd13210f2b1f732c06743b108117f794fb59d7abd2f77d64afe2fb96800a50/matplotlib/matplotlib/issues/9786
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f4dd13210f2b1f732c06743b108117f794fb59d7abd2f77d64afe2fb96800a50/matplotlib/matplotlib/issues/9786
og:image:altBug report Summary The documentation guide contains a section about docstrings. Unfortunately, in my attempt to add / improve some docstrings I found it largely deficient. This issue collects the p...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametimhoffm
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
go-importgithub.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git
octolytics-dimension-user_id215947
octolytics-dimension-user_loginmatplotlib
octolytics-dimension-repository_id1385122
octolytics-dimension-repository_nwomatplotlib/matplotlib
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1385122
octolytics-dimension-repository_network_root_nwomatplotlib/matplotlib
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release07a982c1d40157c619b364352b704c3ce66bb332
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/issues/9786#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F9786
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F9786
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=matplotlib%2Fmatplotlib
Reloadhttps://github.com/matplotlib/matplotlib/issues/9786
Reloadhttps://github.com/matplotlib/matplotlib/issues/9786
Reloadhttps://github.com/matplotlib/matplotlib/issues/9786
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/9786
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/9786
Notifications https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Fork 8.4k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Star 23k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Code https://github.com/matplotlib/matplotlib
Issues 1.1k https://github.com/matplotlib/matplotlib/issues
Pull requests 408 https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality 0 https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
Code https://github.com/matplotlib/matplotlib
Issues https://github.com/matplotlib/matplotlib/issues
Pull requests https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
#9805https://github.com/matplotlib/matplotlib/pull/9805
Consistent Documentation Guide for Docstringshttps://github.com/matplotlib/matplotlib/issues/9786#top
#9805https://github.com/matplotlib/matplotlib/pull/9805
Documentationhttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22Documentation%22
v2.2.0https://github.com/matplotlib/matplotlib/milestone/31
https://github.com/timhoffm
timhoffmhttps://github.com/timhoffm
on Nov 14, 2017https://github.com/matplotlib/matplotlib/issues/9786#issue-273982408
documentation guidehttp://matplotlib.org/devdocs/devel/documenting_mpl.html#documenting-matplotlib
documentation guidehttp://matplotlib.org/devdocs/devel/documenting_mpl.html#documenting-matplotlib
Numpy: How to documenthttps://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
Switch to makefile-based doc build. #9513https://github.com/matplotlib/matplotlib/pull/9513
Inconsistency between " and ' in the code #8079https://github.com/matplotlib/matplotlib/issues/8079
Set return of type Axes in Numpydoc docstring return type hint for Figure.add_subplot and Figure.add_axes to help jedi introspection #7535https://github.com/matplotlib/matplotlib/issues/7535
Docstring section "Other Parameters" not rendering with rest of table #6924https://github.com/matplotlib/matplotlib/issues/6924
docstrings sectionhttp://matplotlib.org/devdocs/devel/documenting_mpl.html#docstrings
docstrings sectionhttp://matplotlib.org/devdocs/devel/documenting_mpl.html#docstrings
See herehttps://github.com/matplotlib/matplotlib/pull/9777#pullrequestreview-76296627
numpyhttps://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
Formattinghttp://matplotlib.org/devdocs/devel/documenting_mpl.html#formatting
See herehttps://github.com/matplotlib/matplotlib/pull/9777#pullrequestreview-76296627
Documentationhttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22Documentation%22
v2.2.0https://github.com/matplotlib/matplotlib/milestone/31
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.