Skip to content

Commit e110a24

Browse files
authored
Merge pull request #874 from int-brain-lab/2.40.1
Resolves #873
2 parents b1dd4e1 + 01b6d08 commit e110a24

8 files changed

+34
-21
lines changed

.github/workflows/ibllib_ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818
max-parallel: 2
1919
matrix:
2020
os: ["windows-latest", "ubuntu-latest"]
21-
python-version: ["3.8", "3.11"]
21+
python-version: ["3.10", "3.12"]
2222
exclude:
2323
- os: windows-latest
24-
python-version: 3.8
24+
python-version: 3.10
2525
- os: ubuntu-latest
26-
python-version: 3.11
26+
python-version: 3.12
2727
steps:
2828
- uses: actions/checkout@v2
2929
- name: Set up Python ${{ matrix.python-version }}

.github/workflows/python-publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Python
1919
uses: actions/setup-python@v2
2020
with:
21-
python-version: '3.8'
21+
python-version: '3.10'
2222
- name: Install dependencies
2323
run: |
2424
python -m pip install --upgrade pip

ibllib/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import logging
33
import warnings
44

5-
__version__ = '2.40.0'
5+
__version__ = '2.40.1'
66
warnings.filterwarnings('always', category=DeprecationWarning, module='ibllib')
77

88
# if this becomes a full-blown library we should let the logging configuration to the discretion of the dev

ibllib/io/raw_data_loaders.py

+1
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ def load_embedded_frame_data(session_path, label: str, raw=False):
200200
"""
201201
Load the embedded frame count and GPIO for a given session. If the file doesn't exist,
202202
or is empty, None values are returned.
203+
203204
:param session_path: Absolute path of session folder
204205
:param label: The specific video to load, one of ('left', 'right', 'body')
205206
:param raw: If True the raw data are returned without preprocessing, otherwise frame count is

ibllib/io/session_params.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def read_params(path) -> dict:
135135
136136
"""
137137
if (path := Path(path)).is_dir():
138-
yaml_file = next(path.glob('_ibl_experiment.description*'), None)
138+
yaml_file = next(path.glob('_ibl_experiment.description*.yaml'), None)
139139
else:
140140
yaml_file = path if path.exists() else None
141141
if not yaml_file:
@@ -165,6 +165,11 @@ def merge_params(a, b, copy=False):
165165
dict
166166
A merged dictionary consisting of fields from `a` and `b`.
167167
"""
168+
def to_hashable(dict_item):
169+
"""Convert protocol -> dict map to hashable tuple of protocol + sorted key value pairs."""
170+
hashable = (dict_item[0], *chain.from_iterable(sorted(dict_item[1].items())))
171+
return tuple(tuple(x) if isinstance(x, list) else x for x in hashable)
172+
168173
if copy:
169174
a = deepcopy(a)
170175
for k in b:
@@ -176,8 +181,6 @@ def merge_params(a, b, copy=False):
176181
# For tasks, keep order and skip duplicates
177182
# Assert tasks is a list of single value dicts
178183
assert (not prev or set(map(len, prev)) == {1}) and set(map(len, b[k])) == {1}
179-
# Convert protocol -> dict map to hashable tuple of protocol + sorted key value pairs
180-
to_hashable = lambda itm: (itm[0], *chain.from_iterable(sorted(itm[1].items()))) # noqa
181184
# Get the set of previous tasks
182185
prev_tasks = set(map(to_hashable, chain.from_iterable(map(dict.items, prev))))
183186
tasks = chain.from_iterable(map(dict.items, b[k]))

ibllib/tests/qc/test_critical_reasons.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def test_note_already_existing(self):
8282

8383
note = one.alyx.rest('notes', 'list', django=f'object_id,{eid}', no_cache=True)
8484
self.assertEqual(len(note), 1)
85-
self.assertNotEquals(original_note_id, note[0]['id'])
85+
self.assertNotEqual(original_note_id, note[0]['id'])
8686

8787
def test_guiinput_ins(self):
8888
eid = self.ins_id # probe id

ibllib/tests/test_io.py

+6
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,12 @@ def test_merge_params(self):
589589
# Test assertion on duplicate sync
590590
b['sync'] = {'foodaq': {'collection': 'raw_sync_data'}}
591591
self.assertRaises(AssertionError, session_params.merge_params, a, b)
592+
# Test how it handles the extractors key, which is an unhashable list
593+
f = {'tasks': [{'fooChoiceWorld': {'collection': 'bar', 'sync_label': 'bpod', 'extractors': ['a', 'b']}}]}
594+
g = session_params.merge_params(a, f, copy=True)
595+
self.assertCountEqual(['devices', 'procedures', 'projects', 'sync', 'tasks', 'version'], g.keys())
596+
self.assertEqual(4, len(g['tasks']))
597+
self.assertDictEqual(f['tasks'][0], g['tasks'][-1])
592598

593599
def test_get_protocol_number(self):
594600
"""Test ibllib.io.session_params.get_task_protocol_number function."""

release_notes.md

+15-12
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
## Release Note 2.40.0
22

33
### features
4-
- iblsorter >= 1.9 sorting tasks with waveform extraction and channel sorting
4+
- iblsorter >= 1.9 sorting tasks with waveform extraction and channel sorting
55
- s3 patcher prototype
66

7+
#### 2.40.1
8+
- Bugfix: ibllib.io.sess_params.merge_params supports tasks extractors key
9+
710
## Release Note 2.39.0
811

912
### features
@@ -18,7 +21,7 @@
1821

1922
#### 2.39.1
2023
- Bugfix: brainbox.metrics.single_unit.quick_unit_metrics fix for indexing of n_spike_below2
21-
-
24+
-
2225
#### 2.39.2
2326
- Bugfix: routing of protocol to extractor through the project repository checks that the
2427
target is indeed an extractor class.
@@ -81,7 +84,7 @@ target is indeed an extractor class.
8184
- oneibl.register_datasets accounts for non existing sessions when checking protected dsets
8285

8386
#### 2.34.1
84-
- Ensure mesoscope frame QC files are sorted before concatenating
87+
- Ensure mesoscope frame QC files are sorted before concatenating
8588
- Look for SESSION_TEMPLATE_ID key of task settings for extraction of pre-generated choice world sequences
8689
- Download required ap.meta files when building pipeline for task_qc command
8790

@@ -145,7 +148,7 @@ target is indeed an extractor class.
145148
- Added ibllib.pipes.dynamic_pipeline.get_trials_tasks function
146149

147150
### bugfixes
148-
- Fix ibllib.io.extractors.ephys_fpga.extract_all for python 3.8
151+
- Fix ibllib.io.extractors.ephys_fpga.extract_all for python 3.8
149152

150153
### other
151154
- Change behavior qc to pass if number of trials > 400 (from start) can be found for which easy trial performance > 0.9
@@ -198,7 +201,7 @@ target is indeed an extractor class.
198201
### features
199202
- Training status pipeline now compatible with dynamic pipeline
200203
- Dynamic DLC task using description file
201-
- Full photometry lookup table
204+
- Full photometry lookup table
202205

203206
### bugfixes
204207
- fix for untrainable, unbiasable don't repopulate if already exists
@@ -213,7 +216,7 @@ target is indeed an extractor class.
213216
- split swanson areas
214217
### bugfixes
215218
- trainig plots
216-
- fix datahandler on SDSC for ONEv2
219+
- fix datahandler on SDSC for ONEv2
217220

218221
### Release Notes 2.23.0 2023-05-19
219222
- quiescence period extraction
@@ -227,7 +230,7 @@ target is indeed an extractor class.
227230
### Release Notes 2.22.2 2023-05-03
228231
### bugfixes
229232
- training plots
230-
-
233+
-
231234
### features
232235
- can change download path for atlas
233236
### Release Notes 2.22.1 2023-05-02
@@ -331,7 +334,7 @@ target is indeed an extractor class.
331334

332335
### Release Notes 2.17.0 2022-10-04
333336
- units quality metrics use latest algorithms for refractory period violations and noise cut-off
334-
337+
335338
## Release Notes 2.16
336339
### Release Notes 2.16.1 2022-09-28
337340
### bugfixes
@@ -350,7 +353,7 @@ target is indeed an extractor class.
350353
- SessionLoader error handling and bug fix
351354

352355
### Release Notes 2.15.2 - 2022-09-22
353-
- extraction pipeline: fix unpacking of empty arguments field from alyx dict that prevents running task
356+
- extraction pipeline: fix unpacking of empty arguments field from alyx dict that prevents running task
354357

355358
### Release Notes 2.15.1 - 2022-09-21
356359
- atlas: gene-expression backend and MRI Toronto atlas stretch and squeeze factors (Dan/Olivier)
@@ -364,7 +367,7 @@ target is indeed an extractor class.
364367
- new modalities:
365368
- photometry extraction (Mainen lab)
366369
- widefield extraction (Churchland lab)
367-
370+
368371
#### bugfixes
369372
- Spike sorting task: parse new pykilosort log format
370373
- Session loader
@@ -439,7 +442,7 @@ target is indeed an extractor class.
439442

440443
### Release Notes 2.10.6 2022-03-15
441444
- Allow parent tasks to be 'Incomplete' to run task on local server
442-
- Change one base_rul for dlc_qc_plot on cortexlab
445+
- Change one base_rul for dlc_qc_plot on cortexlab
443446

444447
### Release Notes 2.10.5 2022-03-11
445448
- Fix moot release accident
@@ -480,7 +483,7 @@ target is indeed an extractor class.
480483

481484
### Release Notes 2.9.0 2022-01-24
482485
- Adding EphysDLC task in ephys_preprocessing pipeline
483-
- NOTE: requires DLC environment to be set up on local servers!
486+
- NOTE: requires DLC environment to be set up on local servers!
484487
- Fixes to EphysPostDLC dlc_qc_plot
485488

486489
## Release Notes 2.8

0 commit comments

Comments
 (0)