GeezerVison is showing github.com — fmt_docstrings: Use string template syntax for docstring placeholders and support curly braces in docstrings by seisman · Pull Request #4210 · GenericMappingTools/pygmt
Conversation
seisman
commented
Nov 15, 2025
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Description of proposed changes
See #3815 for the original issue report and the solution.
This PR uses the string.Template method to avoid using curly braces for docstring placeholders.
Changes in this PR include:
- Update docstring placeholder syntax from
{projection} to $projection
- Rename placeholder
table-classes to table_classes because string.Template doesn't work well with -
- Replace
{{/}} with {/} in LaTeX math equations
Fixes #3815.
Preview:
Wrappers with math equations:
An example page with updated docstring placeholder syntax:
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
seisman
changed the title
fmt_docstrings: Support raw curly braces in docstrings
WIP: fmt_docstrings: Support raw curly braces in docstrings
Nov 15, 2025
seisman
changed the title
WIP: fmt_docstrings: Support raw curly braces in docstrings
fmt_docstrings: Support raw curly braces in docstrings
Nov 15, 2025
seisman
changed the title
fmt_docstrings: Support raw curly braces in docstrings
fmt_docstrings: Use string template syntax for docstring placeholders and support curly braces in docstrings
Nov 15, 2025
|
This is a big change in how the docstrings are written. Hopefully, @weiji14 can give this PR a review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a second I thought this was using Python 3.14 t-strings, but it is unrelated. LGTM!
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
weiji14
weiji14 approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
maintenance
Boring but important stuff for the core devs
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|