Skip to content

Template function docstrings #9050

Open
@vyasr

Description

@vyasr

Many cuDF methods have very similar docstrings, including when the same method is present between different classes, but we currently reproduce most of those docstrings. This increases maintenance burden and the chances of docstrings going out of date. As we work to consolidate more logic a la #9038 we should also consider using more programmatic approaches to share docstrings between related functions, something that pandas does extensively (this has come up in a few of the PRs that already started on the work in #9038).

The main downside to such an approach is that it incurs import time costs that will potentially make import cudf slower. Before diving too deep into trying any such approach, we should verify that the additional import time is not prohibitively slow. I'm reasonably confident that the additional cost will be negligible at the moment, though, because currently importing cupy and numba and setting up the rmm allocator for these account for >90% of the import time. I suspect that unless and until those import times drop, any docstring-related logic that we inject at import time will have a relatively insignificant effect in comparison.

Metadata

Metadata

Assignees

Labels

PythonAffects Python cuDF API.docDocumentationproposalChange current process or code

Type

No type

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions