GithubHelp home page GithubHelp logo

Comments (10)

michaeldeistler avatar michaeldeistler commented on August 17, 2024

I'm fine with pyTorch style

from sbi.

jan-matthis avatar jan-matthis commented on August 17, 2024

Pyro style docstrings in the slice sampler are on purpose, makes it's easier to potentially contribute the slice sampling kernel (so this should be a warranted inconsistency).

For the rest of the code base, I also think it's easiest to just use type annotations in the signature and avoid duplication in the docstring, so just use name: explanation.

from sbi.

alvorithm avatar alvorithm commented on August 17, 2024

OK, then if Jan agrees we keep this issue open and reference it from a sanitize-docstrings PR (to be created).

from sbi.

jan-matthis avatar jan-matthis commented on August 17, 2024

Here is a template for VSCode's autoDocstring without types:

{{! Google Docstring Template without types }}
{{summaryPlaceholder}}

{{extendedSummaryPlaceholder}}

{{#parametersExist}}
Args:
{{#args}}
    {{var}}: {{descriptionPlaceholder}}
{{/args}}
{{#kwargs}}
    {{var}}: {{descriptionPlaceholder}}
{{/kwargs}}
{{/parametersExist}}

{{#returnsExist}}
Returns:
{{#returns}}
    {{typePlaceholder}}: {{descriptionPlaceholder}}
{{/returns}}
{{/returnsExist}}

{{#yieldsExist}}
Yields:
{{#yields}}
    {{typePlaceholder}}: {{descriptionPlaceholder}}
{{/yields}}
{{/yieldsExist}}

from sbi.

alvorithm avatar alvorithm commented on August 17, 2024

Thank you so much. This has to go in a file AFAICT, do you know what the canonical places/names/extensions would if project local or if global? Which one did you end up choosing?

from sbi.

jan-matthis avatar jan-matthis commented on August 17, 2024

I also wondered where to put the file, ended up placing it in a autodocstring subfolder relative to my global settings.json

from sbi.

alvorithm avatar alvorithm commented on August 17, 2024

I wonder whether with 3 of 4 (currently active) devs using vscode and a mandated format for the docstring it'd be too much of a stretch to version in git .vscode/settings.json and the template. Non-vscode users would not be affected, but could also get documentation (e.g. line length) for their own IDEs by looking at it. What do you think?

from sbi.

alvorithm avatar alvorithm commented on August 17, 2024

I put it in ~/.config/Code - Insiders/User/autodocstring.template

from sbi.

janfb avatar janfb commented on August 17, 2024

Thanks! and where and how do you refer to autodocstring.template in vscode?

from sbi.

jan-matthis avatar jan-matthis commented on August 17, 2024

Thanks! and where and how do you refer to autodocstring.template in vscode?

I'll answer in #128

from sbi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.