Skip to content

Fix docstrings#6385

Merged
agramfort merged 5 commits intomne-tools:masterfrom
agramfort:fix_docstring
May 29, 2019
Merged

Fix docstrings#6385
agramfort merged 5 commits intomne-tools:masterfrom
agramfort:fix_docstring

Conversation

@agramfort
Copy link
Copy Markdown
Member

it just factorizes code for n_jobs, seed and random_state docstrings

@massich
Copy link
Copy Markdown
Contributor

massich commented May 29, 2019

This n_jobs which ends up drving n in _get_n_epochs should be factorized aswell or not?

n_jobs : int
How many epochs to process in parallel.

def _get_n_epochs(epochs, n):
"""Generate lists with at most n epochs."""
epochs_out = list()
for epoch in epochs:
if not isinstance(epoch, (list, tuple)):
epoch = (epoch,)
epochs_out.append(epoch)
if len(epochs_out) >= n:
yield epochs_out
epochs_out = list()
if 0 < len(epochs_out) < n:
yield epochs_out

@massich
Copy link
Copy Markdown
Contributor

massich commented May 29, 2019

@larsoner what is the difference to decorate using @verbose or @fill_doc?

I think we should add those things in the contributing guide. (or make developers guide with all those little things as a FAQ)

@codecov
Copy link
Copy Markdown

codecov bot commented May 29, 2019

Codecov Report

Merging #6385 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #6385      +/-   ##
==========================================
+ Coverage   89.32%   89.33%   +<.01%     
==========================================
  Files         408      408              
  Lines       74303    74315      +12     
  Branches    12293    12293              
==========================================
+ Hits        66374    66386      +12     
  Misses       5072     5072              
  Partials     2857     2857

@larsoner
Copy link
Copy Markdown
Member

@verbose does what @fill_doc does, plus controls the verbosity level. Use verbose if the function has a verbose arg and fill_doc if it does not

@drammock
Copy link
Copy Markdown
Member

I was going to tackle this today after all the RandomState nonsense that got wrapped into the tutorials PR. Thanks @agramfort for the head start. I pushed a fix for broken cross-refs (that were my fault anyway) and a fix for duplicate random_state defs in the docdict.

@drammock
Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member

@drammock drammock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@agramfort agramfort merged commit 06b4a1e into mne-tools:master May 29, 2019
@agramfort
Copy link
Copy Markdown
Member Author

thx @massich

@massich
Copy link
Copy Markdown
Contributor

massich commented Jun 2, 2019

I've 2 commits that didn't go in (I could not understand why they were breaking). I'll contribute them in a separate PR.

larsoner pushed a commit to larsoner/mne-python that referenced this pull request Jun 11, 2019
* docstring deduplication

* more n_jobs

* fix: import fill_doc

* fix crossrefs; deduplicate docdict def for random_state
agramfort pushed a commit that referenced this pull request Jun 12, 2019
* FIX: allow raw_fif to parse brainvision events (#6417)

* TST: usecase

* FIX: check annotation description base names

* fix: remove pathlib

* RFC: Alternative without getattr.

* imports

* Fix: avoid adding 'barinvision' as event_id keyword

* remove _get_auto_event_id

* update whatsnew

* Update brainvision.py

* cosmit

* fix

* use rstrip

* MRG+1, DOC: footer logos (#6420)

* add individual inst. logos; add uni-graz

* add image titles (hover)

* force add missing logos

* codespell skip SVG files

* fix: make inria PNG; better logo wrapping

* fix footer overlap; slightly larger logos

* STY: prefer _DefaultEventParser to _Counter (#6355)

* Fix docstrings (#6385)

* docstring deduplication

* more n_jobs

* fix: import fill_doc

* fix crossrefs; deduplicate docdict def for random_state

* FIX: Conftest [circle front]

* FIX: Ref [circle front]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants