Last active
August 14, 2023 11:24
-
-
Save sgbaird/e4b29c64ecf8295b88ce72296a89f2c4 to your computer and use it in GitHub Desktop.
Custom Numpy autoDocstring (https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring) template in VS Code with examples block. Based on https://github.com/NilsJPWerner/autoDocstring/blob/HEAD/docs/numpy.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{! Numpy Docstring Template }} | |
{{summaryPlaceholder}} | |
{{extendedSummaryPlaceholder}} | |
{{#parametersExist}} | |
Parameters | |
---------- | |
{{#args}} | |
{{var}} : {{typePlaceholder}} | |
{{descriptionPlaceholder}} | |
{{/args}} | |
{{#kwargs}} | |
{{var}} : {{typePlaceholder}}, optional | |
{{descriptionPlaceholder}}, by default {{&default}} | |
{{/kwargs}} | |
{{/parametersExist}} | |
{{#returnsExist}} | |
Returns | |
------- | |
{{#returns}} | |
{{typePlaceholder}} | |
{{descriptionPlaceholder}} | |
{{/returns}} | |
{{/returnsExist}} | |
{{#yieldsExist}} | |
Yields | |
------ | |
{{#yields}} | |
{{typePlaceholder}} | |
{{descriptionPlaceholder}} | |
{{/yields}} | |
{{/yieldsExist}} | |
{{#exceptionsExist}} | |
Raises | |
------ | |
{{#exceptions}} | |
{{type}} | |
{{descriptionPlaceholder}} | |
{{/exceptions}} | |
{{/exceptionsExist}} | |
Examples | |
-------- | |
>>> {{name}}({{#args}}{{var}}, {{/args}}, {{#kwargs}}{{var}}={{&default}}, {{/kwargs}}) | |
OUTPUT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment