Repository: spikeinterface/spikeinterface
Issue: Duplicated channel ID in check_recordings_equal

This was caught by the `NwbRecordingExtractor`, which doesn't like having duplicate `channel_ids` specified (which I think is fine since it's a 'bad' input), but the source cause was this line of the the `check_recordings_equal` function: https://github.com/SpikeInterface/spikeinterface/blob/master/spikeinterface/core/testing.py#L28

Code to reproduce:

Download [PlexonRecordingInterface_plexon_recording.zip](https://github.com/SpikeInterface/spikeinterface/files/10077600/PlexonRecordingInterface_plexon_recording.zip)


```python
from spikeinterface.extractors import NwbRecordingExtractor
from spikeinterface.core.testing import check_recordings_equal

rec = NwbRecordingExtractor(file_path="path_to_downloaded_file.nwb")

check_recordings_equal(RX1=rec, RX2=rec)  # Should clearly be true
```

gives traceback

```python
Traceback (most recent call last):

  File "...\\AppData\\Local\\Temp\\ipykernel_4092\\755350667.py", line 1, in <cell line: 1>
    check_recordings_equal(rec, rec)

  File "...\\.conda\\envs\\neuroconv\\lib\\site-packages\\spikeinterface\\core\\testing.py", line 30, in check_recordings_equal
    assert np.allclose(RX1.get_traces(segment_index=segment_idx, channel_ids=ch, start_frame=sf, end_frame=ef,

  File "...\\.conda\\envs\\neuroconv\\lib\\site-packages\\spikeinterface\\core\\baserecording.py", line 119, in get_traces
    traces = rs.get_traces(start_frame=start_frame, end_frame=end_frame, channel_indices=channel_indices)

  File "...\\.conda\\envs\\neuroconv\\lib\\site-packages\\spikeinterface\\extractors\\nwbextractors.py", line 272, in get_traces
    traces = es.data[start_frame:end_frame, channel_indices]

  File "h5py\\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper

  File "h5py\\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper

  File "...\\.conda\\envs\\neuroconv\\lib\\site-packages\\h5py\\_hl\\dataset.py", line 814, in __getitem__
    selection = sel.select(self.shape, args, dataset=self)

  File "...\\.conda\\envs\\neuroconv\\lib\\site-packages\\h5py\\_hl\\selections.py", line 82, in select
    return selector.make_selection(args)

  File "h5py\\_selector.pyx", line 276, in h5py._selector.Selector.make_selection

  File "h5py\\_selector.pyx", line 205, in h5py._selector.Selector.apply_args

TypeError: Indexing elements must be in increasing order
```

and reproducing output of the aforementioned line in `check_recordings_equal` shows why

```python
ch = [rec.get_channel_ids()[0], rec.get_channel_ids()[-1]]
>>> ["V1", "V1"]
```

@alejoe91 @samuelgarcia I'd say the fix should be to modify `check_recordings_equal` to not contain duplicates in the case of a single channel. If you agree I can go ahead and start a PR for the change

Changed files:
spikeinterface/core/testing.py

diff --git a/spikeinterface/core/testing.py b/spikeinterface/core/testing.py
index 84e8d9e5..0dc07a3e 100644
--- a/spikeinterface/core/testing.py
+++ b/spikeinterface/core/testing.py
@@ -25,7 +25,10 @@ def check_recordings_equal(RX1, RX2, return_scaled=True, force_dtype=None):
                 RX2.get_traces(segment_index=segment_idx, return_scaled=return_scaled).astype(force_dtype))
         sf = 0
         ef = N
-        ch = [RX1.get_channel_ids()[0], RX1.get_channel_ids()[-1]]
+        if RX1.get_num_channels() > 1:
+            ch = [RX1.get_channel_ids()[0], RX1.get_channel_ids()[-1]]
+        else:
+            ch = [RX1.get_channel_ids()[0]]
         if force_dtype is None:
             assert np.allclose(RX1.get_traces(segment_index=segment_idx, channel_ids=ch, start_frame=sf, end_frame=ef,
                                               return_scaled=return_scaled),