initial draft of new TD-fNIRS KF2 example#586
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…into ENH_TD-FNIRS_KF2
for more information, see https://pre-commit.ci
…into ENH_TD-FNIRS_KF2
for more information, see https://pre-commit.ci
|
PR adding KF2 tutorial example, as discussed. I have verified that this builds an correct-looking example webpage with @larsoner - do need some help here with getting the CI to pass Some things to note re: the contents of this example:
|
|
FYI I am a bit busy for the next two weeks then should be able to come back to this! |
|
Don't worry about the pip-pre failure it should be fixed by nilearn/nilearn#4724 soon. Can just work on getting the example to run and look good! |
If it's an option to keep as-is with larger docker image can we go with that for now? It would be helpful to focus on the code needed to get this up and running first, and circle back to optimizations next. I think RAM usage limits are also a more general question that would inform a lot of what we decide to add examples for on this topic (e.g. connectivity, source analysis, etc.). |
Okay I pushed a commit that should do it. FWIW bumping the resource class actually costs the mne-tools org compute credits because it's not part of the free tier so we should try to avoid keeping it that way as well long-term if possible unless there is a really compelling use case that we can't get memory usage down for. Even in MNE-Python so far we have managed to avoid this, only in MNE-BIDS-Pipeline have we needed to use it. So I'm cautiously optimistic we might be able to keep memory usage low here, too. |
Good, thanks. Agree to avoiding this being a long-term solution. |
for more information, see https://pre-commit.ci
|
@larsoner @julien-dubois-k I think this is ready for full review now. I did not in the end get round to adding the moments analysis. What I have done here is add the new dataset, plus the data fetcher in mne and dataset repo on OSF, and quite a few updates to the example text and code. I suggest that we tackle the job of extending this demo to include a part that goes all the way from the moments on a new PR thread. The data for that is now there in the downloader files, so should be a fairly easy job. LMK your thoughts. j |
| # TODO: Revert this once our examples are fixed! | ||
| resource_class: large # memory |
|
Okay I moved the dataset downloader here and got CIs green (EDIT: appears headed that way at least!). @JohnGriffiths can you look into reducing memory consumption and runtime if possible? |
|
Yes I can look into memory stuff. LMK
|
off the cuff: less than a minute and less than 2GB (1GB would be better) is what we shoot for in the MNE-Python repo. @larsoner may have a clearer picture of what is OK for MNE-NIRS.
I'd say we're waiting; if we merge now, then every PR will use the large resource class (costing us more money) until the usage is decreased and the resource class reverted to default. |
|
That looks right to me @drammock @JohnGriffiths if you'd prefer I can take another look to see if I can cut down the resource usage without changing the plots/output too much |
|
Hi guys. I have tried a number of things to reduce memory, none make much of a dent, other than removing bits. @larsoner if you do have any bright ideas on how to save memory consumption in mne egs? Is it cumulative? So, things like parallellizing over cores will not help? thx |
* upstream/main: Build(deps): Bump github/codeql-action from 3 to 4 (mne-tools#639) FIX: Rel Fix osf.io downloads, pre-commit autoupdate and fix (mne-tools#640) [pre-commit.ci] pre-commit autoupdate (mne-tools#638) [pre-commit.ci] pre-commit autoupdate (mne-tools#637) [pre-commit.ci] pre-commit autoupdate (mne-tools#636) [pre-commit.ci] pre-commit autoupdate (mne-tools#635) [pre-commit.ci] pre-commit autoupdate (mne-tools#634) Build(deps): Bump actions/setup-python from 5 to 6 (mne-tools#633) [pre-commit.ci] pre-commit autoupdate (mne-tools#632) [pre-commit.ci] pre-commit autoupdate (mne-tools#629) [pre-commit.ci] pre-commit autoupdate (mne-tools#628)
|
Okay here's the last one you produced @JohnGriffiths (185.96 sec 2442.0 MB): And here's after my commit (72.85 sec 702.8 MB): The big change is switching to |
|
Looks fine to me. Nice trick! |
|
Code modifications and comments and images all check out. Related side note: I'm giving an |
|
Okay in it goes, then! Would be good to work on the moments next when you get a chance 😄
No not that I know of... back when I gave MNE-Python tutorials I'd generally start from the |
|
... and version numbers/releases are pretty easy nowadays, here you go: https://pypi.org/project/mne-nirs/0.7.3/ Should land in |
|
Thank you both for pushing this through! |
Ok yes moments next And also DOT analysis for this data
Yup ok this is basically my plan |
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Eric Larson <larson.eric.d@gmail.com>


Following from this PR discussion, this example demonstrates I/O of TD-FNIRS data, and also serves as an introduction to KF2 data.
Code and data based on example code from @julien-dubois-k
Remaining to-do:
hdfaccess bits with references to getting the info from the mnesnirfloader