Repository: mne-tools/mne-bids

Issue:
 module 'mne.chpi' has no attribute 'get_chpi_info'
#### Describe the bug
Getting this error on writing some raw data to bids


#### Steps to reproduce

```python
out_path = pathlib.Path('out_data/sample_BIDS')

bids_path = mne_bids.BIDSPath(subject='01',
                              session='01',
                              task='audiovisual',
                              run='01',
                              root=out_path)

mne_bids.write_raw_bids(raw, bids_path=bids_path, events_data=events,
                        event_id=event_id, overwrite=True)
```
#### Expected results
All expected files should have been added in out_data

#### Actual results

Getting the following AttributeError: module 'mne.chpi' has no attribute 'get_chpi_info



Discussion:
Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽‍♂️

Hello @nikitaagarwala16,

which versions of MNE-BIDS and MNE-Python do you use?
Hello @hoechenberger,
I am currently using MNE- Python version --> '0.23.3' 
and for MNE-BIDS --->'0.8'
Thank you, I will take a look!
Hello, 
I have the same issue.
Is there any solution for that?


Hello @PelinGenc1980 and @nikitaagarwala16,

the respective function, `get_chpi_info`, was only added in the latest development branch of MNE-Python (I'm actually not sure how our tests in MNE-BIDS passed CI, since we test against the development **and** stable branch)

The quick solution is to update your MNE-Python version to the development branch

```
pip install -U https://github.com/mne-tools/mne-python/archive/refs/heads/main.zip
```

@sappelhoff Do you think it's worthwhile to fix this in MNE-BIDS? Otherwise we can just wait until MNE-Python 0.24 is released (few more weeks??)…
I think we can wait a few more weeks. :)
Hello @hoechenberger,

> pip install -U https://github.com/mne-tools/mne-python/archive/refs/heads/main.zip
> ```

Unfortunatelly, it didn't fix my problem. I'm still getting the same error.


It **should** work though. Did you restart your Python interpreter after updating MNE?
Oh yes, I did. Now it gives another error.

It cannot retrieve the storage location of the sample data and gives this error:
RuntimeError: For dataset downloading to work, the pooch module is needed, but it could not be imported.

But adding the pooch module doesn't eliminate the error.


Pooch also depends on `tqdm`, so be sure to install this one as well :) 
Hello @hoechenberger,

I am doing your tutorial on youtube "Pybrain: M/EEG analysis with MNE Python" and have a problem at the very beginning.

After updating MNE-Python version (to solve the error: module 'mne.chpi' has no attribute 'get_chpi_info),
now retrieving the sample data doesn't work any more. As I said previously, it gives "No module named 'pooch'" error. Installing tqdm before installing pooch also didn't help.

Is there any other way to retrieve the storage location of the sample data instead of this line:
sample_data_dir = mne.datasets.sample.data_path()





@PelinGenc1980 please ask usage questions on our user forum: https://mne.discourse.group/

> 
> 
> Hello @hoechenberger,
> 
> I am doing your tutorial on youtube "Pybrain: M/EEG analysis with MNE Python" and have a problem at the very beginning.
> 
> After updating MNE-Python version (to solve the error: module 'mne.chpi' has no attribute 'get_chpi_info), now retrieving the sample data doesn't work any more. As I said previously, it gives "No module named 'pooch'" error. Installing tqdm before installing pooch also didn't help.
> 
> Is there any other way to retrieve the storage location of the sample data instead of this line: sample_data_dir = mne.datasets.sample.data_path()

Did you `pip install pooch` ? 
It worked for me.

Resolving patch:
diff --git a/doc/conf.py b/doc/conf.py
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -140,8 +140,9 @@
 
 html_context = {
     'versions_dropdown': {
-        'dev': 'v0.9 (devel)',
-        'stable': 'v0.8 (stable)',
+        'dev': 'v0.10 (devel)',
+        'stable': 'v0.9 (stable)',
+        'v0.8': 'v0.8',
         'v0.7': 'v0.7',
         'v0.6': 'v0.6',
         'v0.5': 'v0.5',
diff --git a/mne_bids/__init__.py b/mne_bids/__init__.py
--- a/mne_bids/__init__.py
+++ b/mne_bids/__init__.py
@@ -1,6 +1,6 @@
 """MNE software for easily interacting with BIDS compatible datasets."""
 
-__version__ = '0.9.dev0'
+__version__ = '0.9'
 from mne_bids import commands
 from mne_bids.report import make_report
 from mne_bids.path import (BIDSPath, get_datatypes, get_entity_vals,
diff --git a/mne_bids/write.py b/mne_bids/write.py
--- a/mne_bids/write.py
+++ b/mne_bids/write.py
@@ -437,8 +437,7 @@ def _scans_tsv(raw, raw_fname, fname, keep_source, overwrite=False):
     fname : str
         Filename to save the scans.tsv to.
     keep_source : bool
-        If ``True`` (default), ``raw.filenames`` will
-        be stored in the ``source`` column.
+        Wehter to store``raw.filenames`` in the ``source`` column.
     overwrite : bool
         Defaults to False.
         Whether to overwrite the existing data in the file.
@@ -1179,12 +1178,13 @@ def write_raw_bids(raw, bids_path, events_data=None, event_id=None,
 
         ``keep_his`` : bool
             If ``False`` (default), all subject information next to the
-            recording date will be overwritten as well. If True, keep subject
-            information apart from the recording date.
+            recording date will be overwritten as well. If ``True``, keep
+            subject information apart from the recording date.
 
         ``keep_source`` : bool
-            If ``True`` (default), the filename of the raw source will
-            be stored in the ``source`` column of  ``scans.tsv``.
+            Whether to store the name of the ``raw`` input file in the
+            ``source`` column of ``scans.tsv``. By default, this information
+            is not stored.
 
     format : 'auto' | 'BrainVision' | 'EDF' | 'FIF'
         Controls the file format of the data after BIDS conversion. If


Test patch:
diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml
--- a/.github/workflows/unit_tests.yml
+++ b/.github/workflows/unit_tests.yml
@@ -143,7 +143,7 @@ jobs:
     - name: Install MNE (stable)
       if: "matrix.os != 'ubuntu-latest'"
       run: |
-        git clone --depth 1 https://github.com/mne-tools/mne-python.git -b main  # XXX: move to maint/0.24 after release
+        git clone --depth 1 https://github.com/mne-tools/mne-python.git -b maint/0.24
         pip install --no-deps -e ./mne-python
 
     - name: Install MNE (main)