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

Define how to document Python code #296

Open
MattiSG opened this issue Mar 10, 2024 · 1 comment
Open

Define how to document Python code #296

MattiSG opened this issue Mar 10, 2024 · 1 comment

Comments

@MattiSG
Copy link
Member

MattiSG commented Mar 10, 2024

We have many pull requests and issues associated to documentation on Core (see openfisca/openfisca-core#1063).
However, these PRs are often blocked due to a lack of clear understanding on how the code should be documented: which metadata and format should be used?
This specification should take into account the extractability of data, as encountered in #264 (comment).

@bonjourmauko
Copy link
Member

Hello @MattiSG !

Since #264, sphinx tools have evolved. In particular, thanks to #312, documentation will no longer be extracted for types, but only actual type annotations (this has been source of many many bugs).

Concerning style, there are three main formats: google, numpy, and PEP. I'm agnostic on which one, as all three can be linted programmatically (I personally use google, that is how I check my changes).

Concerning sphinx, I do a round-trip here now each time I add documentation in core. By default, sphinx.napoleon understands the three styleguides above, but bugs are somewhat unpredictable.

I don't have a better idea for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants