Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] ENH: print_dir_tree can now return a str instead of only printing #600

Merged
merged 2 commits into from Oct 23, 2020

Conversation

sappelhoff
Copy link
Member

@sappelhoff sappelhoff commented Oct 22, 2020

closes #590

This enhances print_dir_tree to optionally (default False) return a str instead of only printing.

We can then use this to

  1. get a bids dir tree as a str
  2. plot that tree using mpl's plt.text
  3. set that plot as a thumbnail in the examples.

These three steps could be done either:

  • as part of an example --> would be a bit clunky, admittedly
  • during the docs build process --> would require a small python snippet that runs in the back to generate the figures and make sure the examples have the paths to those figures to set as thumbnails.

WDYT?

it's a treatment to make these thumbnails more meaningful:

image

Merge checklist

Maintainer, please confirm the following before merging:

  • All comments resolved
  • This is not your own PR
  • All CIs are happy
  • PR title starts with [MRG]
  • whats_new.rst is updated
  • PR description includes phrase "closes <#issue-number>"

@codecov-io
Copy link

codecov-io commented Oct 22, 2020

Codecov Report

Merging #600 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #600      +/-   ##
==========================================
+ Coverage   92.72%   92.74%   +0.02%     
==========================================
  Files          17       17              
  Lines        2294     2302       +8     
==========================================
+ Hits         2127     2135       +8     
  Misses        167      167              
Impacted Files Coverage Δ
mne_bids/path.py 96.36% <100.00%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d926c3a...da6402c. Read the comment docs.

Copy link
Member

@agramfort agramfort left a comment

Choose a reason for hiding this comment

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

what's new entry?

@sappelhoff sappelhoff changed the title ENH: print_dir_tree can now return a str instead of only printing [MRG] ENH: print_dir_tree can now return a str instead of only printing Oct 22, 2020
@hoechenberger hoechenberger merged commit 2a035c7 into mne-tools:master Oct 23, 2020
@hoechenberger
Copy link
Member

Thanks @sappelhoff!

@sappelhoff sappelhoff deleted the print branch October 23, 2020 07:38
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.

minor enh: allow print_dir_tree to return a str
4 participants