Skip to content

A mechanism for propagating docstring updates? #180

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

Closed
leofang opened this issue May 12, 2021 · 6 comments
Closed

A mechanism for propagating docstring updates? #180

leofang opened this issue May 12, 2021 · 6 comments
Labels
Tools Issue or pull request pertaining to tooling for authoring and managing this specification.

Comments

@leofang
Copy link
Contributor

leofang commented May 12, 2021

It's midnight so I might be asking silly or trivial questions...Let me know if I am! 😄

I think as we move forward and finalize the standard while downstream libraries start to implement the support, an apparent burden is to add docstings to all Array APIs. We certainly do not want to manually copy and paste all the docstrings from the standard, but rather we would rely on some kind of tools (should be a simple script?) to parse it.

However, is there a better way already conceived on how to propagate docstring changes to downstream? For example, if we fix a few docstrings in this repo, is there a mechanism (hopefully automated) to propagate it to all stakeholder projects (and perhaps beyond) at once? Or does it require each project's maintainer to inspect and determine from the fix if an API behavior is changed and so requires some code change as well?

@rgommers
Copy link
Member

Good question. @asmeurer is updating the test suite regularly and parses the API docs to ensure docs and tests stay in sync, so I assume that updating to the latest version of the test suite should catch most/all of the changes. Maybe it'd be a matter of running one CI job against main of https://github.com/data-apis/array-api-tests?

@asmeurer
Copy link
Member

What info are you including in the docstrings? My script in the test suite parses the signatures and some additional metadata, but doesn't parse everything. I've argued in the past that it would be helpful to have the spec in a machine readable format #49.

@leofang
Copy link
Contributor Author

leofang commented May 19, 2021

Maybe it'd be a matter of running one CI job against main of https://github.com/data-apis/array-api-tests?

Sounds like a good idea to start with.

What info are you including in the docstrings?

The whole docstring. 1-to-1 copy, with library-specific stuff appended at the end (possibly starting with .. note::). This way the maintenance cost is close to zero.

I've argued in the past that it would be helpful to have the spec in a machine readable format #49.

It'd be cool to have, though I am not sure if it'd increase our maintenance cost (for this repo) or not.

@rgommers
Copy link
Member

The whole docstring. 1-to-1 copy, with library-specific stuff appended at the end

This is kind of problematic with docstring parsing, e.g. numpydoc chokes on duplicate sections. Also not easy to insert examples that way, you have to create some generic one and then replace the library name.

I think it'd be good to make copying content as easy as possible though. We've accumulated some technical debt here; the API docs really should have been in reST.

@kgryte kgryte added the Tools Issue or pull request pertaining to tooling for authoring and managing this specification. label Oct 4, 2021
@kgryte kgryte added this to the v2022 milestone Oct 4, 2021
@rgommers
Copy link
Member

Should this issue remain open? The API docs are now in .py files for easy reuse.

@rgommers rgommers removed this from the v2022 milestone Dec 15, 2022
@rgommers
Copy link
Member

rgommers commented Mar 9, 2023

I'll close this - having it available as regular docstrings makes them programmatically accessible, that's about as good as we can or need to do here. Thanks all!

@rgommers rgommers closed this as completed Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tools Issue or pull request pertaining to tooling for authoring and managing this specification.
Projects
None yet
Development

No branches or pull requests

4 participants