question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Standard for documentation types

See original GitHub issue

Tell us about it

Documentation uses numpydoc and is linted using pydocstyle. However, the format of the type is not checked. Specifically, densityplot.py now uses proper type hinting, while everywhere else uses a less rigorous style emulating other pydata projects (int, optional, instead of Optional[int], for example)

I am most in favor of consistency across the code base, which would suggest changing densityplot.py. I would also prefer type hinting everywhere to our current standard.

Specifically: I think we should manually urge new contributions to match current documentation practices, but I would also accept a pull request that converts a reasonable portion of the codebase to the new style.

Thoughts on implementation

My feelings on this are weak enough that I do not think it should be in CONTRIBUTING.md, since every requirement there feels like a hurdle to engagement. If we ended up in a place with type hinting everywhere, then I would be in favor of adding it.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
OriolAbrilcommented, Jan 16, 2020

mypy is to be used in the code itself, not in the docstrings. See example below.

def from_pymc3(
    trace: MultiTrace, prior: Optional[Dict[str, np.ndarray]]=None, ...
) -> InferenceData:
    """
    Converts ...

    Parameters:
    trace: pymc3.MultiTrace
        description
    prior: dict of {str: np.ndarray}, optional
        description
    ...
    """
    code
    ...
1reaction
percygautamcommented, Jan 16, 2020

@OriolAbril So, we have to extend the contribution guide about new links suggested by @canyon289 . This can also be added to the new PR template being added. Also, are you suggesting to change all docstrings to mypy format?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is the Best Standard for Technical Documentation?
Which technical documentation standard is the “best?” This question is loaded with proverbial ... Standard, Type, Year Invented, Inventor.
Read more >
Documentation standards
There are three types of documentation standards: Documentation process standards These standards define the process that should be followed for document ...
Read more >
The Importance of Documentation Standards | The Workstream
The best way to get documentation that works is to establish documentation standards. These are the rules that guide the creation and distribution...
Read more >
Technical Documentation in Software Development - AltexSoft
The common examples of process-related documents are standards, project documentation, such as project plans, test schedules, reports, meeting ...
Read more >
Software Documentation Types and Best Practices - Prototypr
It usually consists of the requirements document, architecture design, source code, validation docs, verification and testing info, and a maintenance or help ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found