# remove output from joblib

**URL:** <https://mne.discourse.group/t/remove-output-from-joblib/7303>\
**Category:** Support & Discussions\
**Created:** [July 27, 2023, 5:23pm UTC](https://mne.discourse.group/t/remove-output-from-joblib/7303 "2023-07-27T17:23:31Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![chapochn](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/chapochn/32/915_2.png) [@chapochn](https://mne.discourse.group/u/chapochn)\
**Post date:** [July 27, 2023, 5:23pm UTC](https://mne.discourse.group/t/remove-output-from-joblib/7303/1 "2023-07-27T17:23:31Z")

</div>

- MNE version: 1.4
- operating system: macOS 13.4

I am running some code with `raw.compute_psd` with option `n_jobs=16`.  
I am getting the output:

```python
[Parallel(n_jobs=16)]: Using backend LokyBackend with 16 concurrent workers.
[Parallel(n_jobs=16)]: Done 5 out of 16 | elapsed: 1.9s remaining: 4.2s
[Parallel(n_jobs=16)]: Done 9 out of 16 | elapsed: 2.0s remaining: 1.5s
[Parallel(n_jobs=16)]: Done 13 out of 16 | elapsed: 2.0s remaining: 0.5s
[Parallel(n_jobs=16)]: Done 16 out of 16 | elapsed: 2.1s finished

```

How do I suppress this output? I tried `verbose=0` inside the `compute_psd` function. I also tried to put the computation inside a `with joblib.parallel_config(verbose=0):`, but no success.

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![drammock](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/drammock/32/4_2.png) [@drammock](https://mne.discourse.group/u/drammock)\
**Post date:** [July 28, 2023, 7:22pm UTC](https://mne.discourse.group/t/remove-output-from-joblib/7303/2 "2023-07-28T19:22:03Z")

</div>

```python
import mne
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = (sample_data_folder / 'MEG' / 'sample' / 'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False, preload=False)
spect = raw.compute_psd(n_jobs=12, verbose=False)

```

When I run this on current main I see no joblib output.

The problem is passing `verbose=0` instead of `verbose=False`. “truthy” and “falsy” values won’t do what you expect here, because underlyingly verbose is a system of integers/strings, and we use `True` and `False` as aliases for specific integer levels. See the table here: [Configuring MNE-Python — MNE 1.4.2 documentation](https://mne.tools/stable/auto_tutorials/intro/50_configure_mne.html#logging)

---

<div class="post-metadata">

**Author:** ![chapochn](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/chapochn/32/915_2.png) [@chapochn](https://mne.discourse.group/u/chapochn)\
**Post date:** [August 8, 2023, 6:12pm UTC](https://mne.discourse.group/t/remove-output-from-joblib/7303/3 "2023-08-08T18:12:53Z")

</div>

Thank you! However it is also removing the information like:

> Effective window size : 8.000 (s)

But that’s something I would like to keep. Is there some way to only remove the joblib output without removing the mne output?

---

<div class="post-metadata">

**Author:** ![drammock](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/drammock/32/4_2.png) [@drammock](https://mne.discourse.group/u/drammock)\
**Post date:** [August 8, 2023, 6:41pm UTC](https://mne.discourse.group/t/remove-output-from-joblib/7303/4 "2023-08-08T18:41:28Z")

</div>

> [@chapochn](#):
>
> Is there some way to only remove the joblib output without removing the mne output?

Not presently (at least not that i can see). @larsoner WDYT about this? one reasonable approach might be a config value (`MNE_JOBLIB_LOGGING_LEVEL` or so) that can be set separately from the global logging level.

---

<div class="post-metadata">

**Author:** ![chapochn](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/chapochn/32/915_2.png) [@chapochn](https://mne.discourse.group/u/chapochn)\
**Post date:** [August 8, 2023, 6:53pm UTC](https://mne.discourse.group/t/remove-output-from-joblib/7303/5 "2023-08-08T18:53:23Z")

</div>

Yes, 2 different verboses options/configs would be great I imagine…

---

<div class="post-metadata">

**Author:** ![larsoner](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/larsoner/32/3_2.png) [@larsoner](https://mne.discourse.group/u/larsoner)\
**Post date:** [August 8, 2023, 10:49pm UTC](https://mne.discourse.group/t/remove-output-from-joblib/7303/6 "2023-08-08T22:49:24Z")

</div>

Sounds good to me. We could add it to `set_log_level` and `use_log_level`, and have the default `joblib_verbose=None` mean “use the `verbose` level” (which would preserve backward compat)

---

<div class="post-metadata">

**Author:** ![drammock](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/drammock/32/4_2.png) [@drammock](https://mne.discourse.group/u/drammock)\
**Post date:** [August 9, 2023, 2:02pm UTC](https://mne.discourse.group/t/remove-output-from-joblib/7303/7 "2023-08-09T14:02:13Z")

</div>

@chapochn would you be up for making a PR to implement this? If not, please open a GitHub issue linking back to this thread, so that we don’t lose track of the request.

---

<div class="post-metadata">

**Author:** ![chapochn](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/chapochn/32/915_2.png) [@chapochn](https://mne.discourse.group/u/chapochn)\
**Post date:** [August 18, 2023, 3:36pm UTC](https://mne.discourse.group/t/remove-output-from-joblib/7303/8 "2023-08-18T15:36:20Z")

</div>

I’ll just open an issue for now!

---

<div class="post-metadata">

**Author:** ![chapochn](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/chapochn/32/915_2.png) [@chapochn](https://mne.discourse.group/u/chapochn)\
**Post date:** [August 18, 2023, 3:42pm UTC](https://mne.discourse.group/t/remove-output-from-joblib/7303/9 "2023-08-18T15:42:03Z")

</div>

Here:

> <https://github.com/mne-tools/mne-python/issues/11902>
>
> \### Describe the new feature or enhancement
> 
> Add the option to control the verbo…sity of joblib without affecting the verbosity of joblib. See discussion here:
> https://mne.discourse.group/t/remove-output-from-joblib/7303
> 
> \### Describe your proposed implementation
> 
> Proposed by @drammock and @larsoner:
> \`one reasonable approach might be a config value (MNE\_JOBLIB\_LOGGING\_LEVEL or so) that can be set separately from the global logging level.\`
> \`Sounds good to me. We could add it to set\_log\_level and use\_log\_level, and have the default joblib\_verbose=None mean “use the verbose level” (which would preserve backward compat)\`
> 
> Copied from:
> https://mne.discourse.group/t/remove-output-from-joblib/7303
> 
> \### Describe possible alternatives
> 
> N/A
> 
> \### Additional context
> 
> \_No response\_
