Skip to content

Nexus: migrate docstrings for clarity#6027

Closed
jtkrogel wants to merge 1 commit into
QMCPACK:developfrom
jtkrogel:nx_docstring
Closed

Nexus: migrate docstrings for clarity#6027
jtkrogel wants to merge 1 commit into
QMCPACK:developfrom
jtkrogel:nx_docstring

Conversation

@jtkrogel

@jtkrogel jtkrogel commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

In Python, proper doctrings are often large, easily eclipsing the length of the e.g. function they were created to document. This adds excessive clutter when reading the code in file editors or on Github.

This PR adds a directory for docstrings that are imported and bound to the respective functions, etc. Outside queries like help work, and automatic creation of online docs should also be compatible with this (further testing needed).

@prckent prckent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Q. Have you tried a folding editor to hide the docstrings? I thought you used emacs which surely has some packages that can help?

More generally, I think your proposed solution will cause more problems than it solves. In particular, separation of docs from the code is a key thing that we are trying to avoid with docstrings. They works with many large projects and their use is completely standard in the python world. Perhaps others can suggest a route to avoid the visual disruption that you are trying to avoid? (@brockdyer03 , @PDoakORNL , @ye-luo ?)

Despite using various editors with fancy formatting and folding features, my personal solution is to simply hit page down more frequently.

Whatever is done here -- if anything -- should not be artisanal and should be common to many other major projects imo, otherwise it is just one more oddity for potential contributors to hurdle over.

@jtkrogel

jtkrogel commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

This is not artisinal. The widely used and well documented numpy package does exactly this.

@prckent

prckent commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

numpy does this

Great. What about a simpler editor solution though? Is this really necessary? Surely every editor in wide use can fold the code if the length is a problem?

@jtkrogel

jtkrogel commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

I can see this is viewed as a narrow problem. Retracting suggestion.

@jtkrogel jtkrogel closed this Jul 7, 2026
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

Successfully merging this pull request may close these issues.

2 participants