Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HOTFIX 2.28.1 #714

Merged
merged 27 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
704a1f3
change behavior qc to truncate trials up until 400 and check if perfo…
juhuntenburg Dec 13, 2023
8328a12
add @sleepless decorator (#655)
bimac Dec 15, 2023
7aaaaa4
Add get_trials_tasks function
k1o0 Dec 15, 2023
185ec7e
Merge pull request #690 from int-brain-lab/getTrialsTask
k1o0 Dec 18, 2023
3e9fea4
data release update
GaelleChapuis Dec 22, 2023
c6cb74b
Merge pull request #697 from int-brain-lab/docs
GaelleChapuis Dec 22, 2023
d181227
change number of parallel workflows
mayofaulkner Dec 22, 2023
00145f0
Merge pull request #698 from int-brain-lab/workflow
mayofaulkner Dec 22, 2023
a0d62ac
data release update
GaelleChapuis Jan 3, 2024
b2618a6
Merge pull request #699 from int-brain-lab/docs
GaelleChapuis Jan 3, 2024
79141a5
Merge branch 'develop' into behavior_qc
juhuntenburg Jan 3, 2024
98043b9
Merge pull request #683 from int-brain-lab/behavior_qc
juhuntenburg Jan 3, 2024
39c7a1f
add to release notes
juhuntenburg Jan 3, 2024
d0f202a
Issue #701
k1o0 Jan 4, 2024
ed9bdea
Merge pull request #702 from int-brain-lab/hotfix/2.27.2
k1o0 Jan 4, 2024
bf1c4cb
Update release notes and version
k1o0 Jan 4, 2024
e73282a
Merge branch 'master' into develop
k1o0 Jan 4, 2024
32b0010
Update release notes
k1o0 Jan 4, 2024
ad9f306
Auto stash before checking out "origin/develop"
mayofaulkner Jan 8, 2024
adf236e
Merge pull request #706 from int-brain-lab/phaseChoice_extractor
mayofaulkner Jan 8, 2024
550f783
typo in EphysPostDLC init
juhuntenburg Jan 10, 2024
9f43340
Fix patch_settings for iblrigv8 (#713)
k1o0 Jan 18, 2024
5176c97
Update release notes
k1o0 Jan 18, 2024
8ad2ebb
Update release notes
k1o0 Jan 18, 2024
f340664
Merge branch 'develop' of https://github.com/int-brain-lab/ibllib int…
k1o0 Jan 18, 2024
8c5b025
Update release notes
k1o0 Jan 18, 2024
dcac832
Merge branch 'master' into develop
k1o0 Jan 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ibllib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import logging
import warnings

__version__ = '2.28'
__version__ = '2.28.1'
warnings.filterwarnings('always', category=DeprecationWarning, module='ibllib')

# if this becomes a full-blown library we should let the logging configuration to the discretion of the dev
Expand Down
3 changes: 2 additions & 1 deletion ibllib/io/extractors/extractor_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
"_habituationChoiceWorld": "habituation",
"_trainingChoiceWorld": "training",
"ephysMockChoiceWorld": "mock_ephys",
"ephys_certification": "sync_ephys"
"ephys_certification": "sync_ephys",
"trainingPhaseChoiceWorld": "training"
}
19 changes: 7 additions & 12 deletions ibllib/io/raw_data_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,16 +736,6 @@ def _groom_wheel_data_ge5(data, label='file ', path=''):
return data


def save_bool(save, dataset_type):
if isinstance(save, bool):
out = save
elif isinstance(save, list):
out = (dataset_type in save) or (Path(dataset_type).stem in save)
if out:
_logger.debug('extracting' + dataset_type)
return out


def sync_trials_robust(t0, t1, diff_threshold=0.001, drift_threshold_ppm=200, max_shift=5,
return_index=False):
"""
Expand Down Expand Up @@ -945,7 +935,7 @@ def patch_settings(session_path, collection='raw_behavior_data',
if not settings:
raise IOError('Settings file not found')

filename = PureWindowsPath(settings['SETTINGS_FILE_PATH']).name
filename = PureWindowsPath(settings.get('SETTINGS_FILE_PATH', '_iblrig_taskSettings.raw.json')).name
file_path = Path(session_path).joinpath(collection, filename)

if subject:
Expand All @@ -955,7 +945,8 @@ def patch_settings(session_path, collection='raw_behavior_data',
for k in settings.keys():
if isinstance(settings[k], str):
settings[k] = settings[k].replace(f'\\Subjects\\{old_subject}', f'\\Subjects\\{subject}')
settings['SESSION_NAME'] = '\\'.join([subject, *settings['SESSION_NAME'].split('\\')[1:]])
if 'SESSION_NAME' in settings:
settings['SESSION_NAME'] = '\\'.join([subject, *settings['SESSION_NAME'].split('\\')[1:]])
settings.pop('PYBPOD_SUBJECT_EXTRA', None) # Get rid of Alyx subject info

if date:
Expand All @@ -970,6 +961,10 @@ def patch_settings(session_path, collection='raw_behavior_data',
f'\\{settings["SUBJECT_NAME"]}\\{date}'
)
settings['SESSION_DATETIME'] = date + settings['SESSION_DATETIME'][10:]
if 'SESSION_END_TIME' in settings:
settings['SESSION_END_TIME'] = date + settings['SESSION_END_TIME'][10:]
if 'SESSION_START_TIME' in settings:
settings['SESSION_START_TIME'] = date + settings['SESSION_START_TIME'][10:]

if number:
# Patch session number
Expand Down
18 changes: 5 additions & 13 deletions ibllib/io/session_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from copy import deepcopy

from one.converters import ConversionMixin
from iblutil.util import flatten
from packaging import version

import ibllib.pipes.misc as misc
Expand Down Expand Up @@ -391,15 +392,15 @@ def get_collections(sess_params, flat=False):
sess_params : dict
The loaded experiment description map.
flat : bool (False)
If True, return a flat list of unique collections, otherwise return a map of device/sync/task
If True, return a flat set of collections, otherwise return a map of device/sync/task

Returns
-------
dict[str, str]
A map of device/sync/task and the corresponding collection name.

list[str]
A flat list of unique collection names.
set[str]
A set of unique collection names.

Notes
-----
Expand All @@ -423,16 +424,7 @@ def iter_dict(d):
iter_dict(v)

iter_dict(sess_params)
if flat:
cflat = []
for k, v in collection_map.items():
if isinstance(v, list):
cflat.extend(v)
else:
cflat.append(v)
return list(set(cflat))
else:
return collection_map
return set(flatten(collection_map.values())) if flat else collection_map


def get_video_compressed(sess_params):
Expand Down
2 changes: 1 addition & 1 deletion ibllib/pipes/video_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ class EphysPostDLC(base_tasks.VideoTask):
level = 3
force = True

def __int__(self, *args, **kwargs):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.trials_collection = kwargs.get('trials_collection', 'alf')

Expand Down
18 changes: 17 additions & 1 deletion ibllib/tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,15 @@ def test_load_encoder_trial_info(self):
self.session = Path(__file__).parent.joinpath('extractors', 'data', 'session_biased_ge5')
data = raw.load_encoder_trial_info(self.session)
self.assertTrue(data is not None)
self.assertIsNone(raw.load_encoder_trial_info(self.session.with_name('empty')))
self.assertIsNone(raw.load_encoder_trial_info(None))

def test_load_camera_ssv_times(self):
session = Path(__file__).parent.joinpath('extractors', 'data', 'session_ephys')
with self.assertRaises(ValueError):
raw.load_camera_ssv_times(session, 'tail')
with self.assertRaises(FileNotFoundError):
raw.load_camera_ssv_times(session.with_name('foobar'), 'body')
bonsai, camera = raw.load_camera_ssv_times(session, 'body')
self.assertTrue(bonsai.size == camera.size == 6001)
self.assertEqual(bonsai.dtype.str, '<M8[ns]')
Expand Down Expand Up @@ -297,6 +301,18 @@ def test_load_camera_frameData(self):
self.assertTrue(fd.dtypes.to_dict() == parsed_dtypes)
self.assertTrue(all([x == np.int64 for x in fd_raw.dtypes]))

def test_load_settings(self):
main_path = Path(__file__).parent.joinpath('extractors', 'data')
self.training_ge5 = main_path / 'session_training_ge5'
settings = raw.load_settings(self.training_ge5)
self.assertIsInstance(settings, dict)
self.assertEqual(144, len(settings))
with self.assertLogs(raw._logger, level=20):
self.assertIsNone(raw.load_settings(None))
# Should return None when path empty
with self.assertLogs(raw._logger, level=20):
self.assertIsNone(raw.load_settings(self.training_ge5, 'raw_task_data_00'))

def tearDown(self):
self.tempfile.close()
os.unlink(self.tempfile.name)
Expand Down Expand Up @@ -588,7 +604,7 @@ def test_get_collections_repeat_protocols(self):
collections = session_params.get_collections(tasks)
self.assertEqual(set(collections['passiveChoiceWorld']), set(['raw_passive_data_bis', 'raw_passive_data']))
collections = session_params.get_collections(tasks, flat=True)
self.assertEqual(set(collections), set(['raw_passive_data_bis', 'raw_passive_data', 'raw_behavior_data']))
self.assertEqual(collections, {'raw_passive_data_bis', 'raw_passive_data', 'raw_behavior_data'})


class TestRawDaqLoaders(unittest.TestCase):
Expand Down
4 changes: 4 additions & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
### other
- Change behavior qc to pass if number of trials > 400 (from start) can be found for which easy trial performance > 0.9

#### 2.28.1
- Typo in ibllib.pipes.video_tasks.EphysPostDLC class
- ibllib.io.raw_data_loaders.patch_settings works with iblrigv8 settings files

## Release Notes 2.27

### features
Expand Down
Loading