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.

[RFC] changing python type by a term definition in docstring

See original GitHub issue

In the following docstring instead of using the python type as description, could we use a glossary term instead?

https://github.com/mne-tools/mne-python/blob/adb70865accfbf2e473d0f78e5be69c090581c0d/mne/io/meas_info.py#L205-L207

Or maybe we should keep the python type and link the term in the description.

    dig : list of dict | None
        The Polhemus :term:`digitization` data in head coordinates.
        See Notes for more information.

WDYT?

cc: @drammock, @larsoner, @agramfort

Maybe something like this could work:

numpydoc_xref_aliases = {
    'Popen': 'python:subprocess.Popen',
    'file-like': ':term:`file-like <python:file object>`',
    ...
    # MNE
    'Label': 'mne.Label', 'Forward': 'mne.Forward', 'Evoked': 'mne.Evoked',
    ...
    'Transform': 'mne.transforms.Transform',
    # MNE-terms
    'digitization': ':term:`digitization`',
}

Suggested term

digitization (abbr. dig) digpoint

Suggested definition

digitization: list of digpoints digpoint: Dictionary contaning ~Polhemus~ digitization data (kind, identifier, position, and coord_frame)

@drammock feel free to rephrase the whole thing 😉 (or push me to do it)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
agramfortcommented, Aug 22, 2019

sounds good !

+1 to add a “digitization” entry in glossary

in the place you point to we should not mention Polhemus. it’s not the only system to get a valid digitization.

0reactions
larsonercommented, Sep 21, 2019

Whoops I mean #6461

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documenting Python APIs with Docstrings
'Parameters' is a description of a function or method's arguments and their respective types. Parameters should be listed in the same order as...
Read more >
Specify types with docstrings | PyCharm Documentation
Generate reference documentation. Specify types with docstrings. Legacy type syntax for docstrings. Type hinting in PyCharm. Pattern matching.
Read more >
PEP 287 – reStructuredText Docstring Format
This PEP proposes that the reStructuredText markup be adopted as a standard markup format for structured plaintext documentation in Python ...
Read more >
Python Docstrings (With Examples) - Programiz
Python docstrings are the string literals that appear right after the definition of a function, method, class, or module. Let's take an example....
Read more >
Python Style Guide Update: PEP 8, flake8 & Numpydoc
What does this Numpydoc change mean? RFC-214 has essentially given DM developers permission to use the Numpydoc format for docstrings. That is, ...
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