mne-python icon indicating copy to clipboard operation
mne-python copied to clipboard

Is there a way to show the "directory" tree of the files in each mne.datasets?

Open adam2392 opened this issue 3 years ago • 3 comments
trafficstars

Describe the new feature or enhancement

When a developer is using the datasets available in mne.datasets e.g. https://mne.tools/stable/generated/mne.datasets.sample.data_path.html

then usually they actually don't know what's in the dataset, so they probably would need to inspect the entire folder to understand the filenames and subdirectories. It would be nice to see the file directory within each docstring to enable a more seamless dev experience.

Describe your proposed implementation

Idk how, but somehow piping the output of something like print_dir_tree of each datasets into their respective docstring?

Describe possible alternatives

Someone can just download the dataset I suppose and inspect it.

Alternatively, perhaps this page can be updated and linked within each dataset function? https://mne.tools/stable/overview/datasets_index.html#datasets

Additional comments

The idea came up in https://github.com/mne-tools/mne-connectivity/pull/100#discussion_r902953820

adam2392 avatar Jun 21 '22 19:06 adam2392

$ cd /path/to/mne_data
$ tree mTRF_1.5
mTRF_1.5
├── coherentmotion_data.mat
├── contrast_data.mat
├── lagGen.m
├── mTRFcrossval.m
├── mTRFmulticrossval.m
├── mTRFpredict.m
├── mTRFtrain.m
├── mTRFtransform.m
├── README.txt
└── speech_data.mat

0 directories, 10 files

repeat as needed for other datasets besides mTRF

drammock avatar Jun 21 '22 19:06 drammock

Is it worth adding those code to the datasets docstring?

adam2392 avatar Jun 21 '22 19:06 adam2392

🤷🏻 seems like it would have helped you if that note were in the docstring right? It ought to work on Windows and Linux at least; I'd say if you can verify it (or something similar) works for Mac, go ahead and add it.

drammock avatar Jun 21 '22 19:06 drammock