DCAN-Labs / BIBSnet

This BIDS App provides the utility of creating a nnU-Net anatomical MRI segmentation and mask with a infant brain trained model. It can easily be included in other processing pipelines and for circumventing JLF within Nibabies.
https://bibsnet.readthedocs.io/en/latest/
Apache License 2.0
4 stars 8 forks source link

Deal with WARNING messages output at top of logs in some way so that they don't confuse users #140

Open LuciMoore opened 1 month ago

LuciMoore commented 1 month ago

A short summary of what you would like to see in BIBSnet.

Look into common WARNINGs that pop up for folks when running BIBSNet. these shouldn't impact anything, but might be good to either address, suppress the warning, add logging to explain it can be safely ignored, etc:

"uname": executable file not found in $PATH Matplotlib created a temporary config/cache directory at /tmp/matplotlib-6yivpubv because the default path (/users/2/kweldon/.config/matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.

Do you have any interest in helping implement the feature?

Yes!

Add any additional information or context about the request here.

No response

scott-huberty commented 1 month ago

Naively I would think that for the Matplotlib warning, it's better to just explicitly set the config directory within the container, i.e. BIBSnet shouldn't be writing to folders outside the container anyways (unless we specifically mount them).

Something like this ?

from pathlib import Path
import os

Path.mkdir(Path.home() / "bibsnet" / "configs") # might need to adjust the permissions via `mode` argument
os.environ['MPLCONFIGDIR'] = Path.home() / "bibsnet" / "configs"