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

Globus deprecation #647

Merged
merged 27 commits into from
Dec 12, 2023
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
270fdd4
Deprecate globus module
k1o0 Aug 30, 2023
0e60893
Use ONE Globus in patcher
k1o0 Sep 6, 2023
d97ccd1
Add delete_dataset method
k1o0 Sep 6, 2023
64e72f3
Delete S3 files
k1o0 Sep 11, 2023
1889e7c
Bump ONE version
k1o0 Sep 15, 2023
8511bb6
Merge branch 'develop' into globusDeprecation
k1o0 Sep 26, 2023
a497411
sync extension optional; reduce logging clutter
k1o0 Oct 6, 2023
6c04956
flake8
k1o0 Oct 6, 2023
3d8a626
Merge branch 'develop' into globusDeprecation
k1o0 Oct 6, 2023
5f97c0b
Move url2uri to ONE
k1o0 Oct 17, 2023
bc52877
Merge branch 'develop' into globusDeprecation
k1o0 Oct 18, 2023
e761f67
Test GlobusPatcher
k1o0 Oct 23, 2023
5a46c63
Merge branch 'develop' into globusDeprecation
k1o0 Oct 23, 2023
154d4cd
Moved Mayo's examples to tasks.py module
k1o0 Oct 23, 2023
7277c78
Merge branch 'globusDeprecation' of https://github.com/int-brain-lab/…
k1o0 Oct 23, 2023
148c4c2
Ensure paths are str in GlobusPatcher; ignore tmin, tmax if no trials…
k1o0 Oct 23, 2023
47b5eff
remove deprecated psychofit module; fix tests
k1o0 Oct 24, 2023
166c4c5
bump ONE version
k1o0 Nov 2, 2023
262bb75
Extend globus module deprecation
k1o0 Nov 6, 2023
d31d7d1
Merge branch 'develop' into globusDeprecation
k1o0 Dec 11, 2023
74e57b8
Merge branch 'develop' into globusDeprecation
k1o0 Dec 11, 2023
0ca5082
use get_bpod_event_times
k1o0 Dec 11, 2023
b31d14e
Increase default protocol period
k1o0 Dec 12, 2023
da365e6
Merge branch 'develop' into globusDeprecation
k1o0 Dec 12, 2023
49ad5a3
Test new extractor methods
k1o0 Dec 12, 2023
48cfcd0
Move test_ephys_trials tests to test_ephys_fpga; remove old functions
k1o0 Dec 12, 2023
276603e
Added trainingPhaseChoiceWorld to task protocol extractor map; fix ty…
k1o0 Dec 12, 2023
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
306 changes: 0 additions & 306 deletions brainbox/behavior/pyschofit.py

This file was deleted.

1 change: 0 additions & 1 deletion brainbox/behavior/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
from one.api import ONE
from one.alf.io import AlfBunch
from one.alf.exceptions import ALFObjectNotFound

import psychofit as psy

_logger = logging.getLogger('ibllib')
Expand Down
47 changes: 4 additions & 43 deletions ibllib/ephys/ephysqc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""
from pathlib import Path
import logging
import shutil

import numpy as np
import pandas as pd
Expand All @@ -19,7 +18,7 @@
from brainbox.metrics.single_units import spike_sorting_metrics
from ibllib.ephys import sync_probes, spikes
from ibllib.qc import base
from ibllib.io.extractors import ephys_fpga, training_wheel
from ibllib.io.extractors import ephys_fpga
from phylib.io import model


Expand Down Expand Up @@ -370,8 +369,9 @@ def _single_test(assertion, str_ok, str_ko):
str_ok="PASS: Bpod", str_ko="FAILED: Bpod")
try:
# note: tried to depend as little as possible on the extraction code but for the valve...
bpod = ephys_fpga.get_sync_fronts(rawsync, sync_map['bpod'])
_, t_valve_open, _ = ephys_fpga._assign_events_bpod(bpod['times'], bpod['polarities'])
extractor = ephys_fpga.FpgaTrials(ses_path)
_, bpod_intervals = extractor.get_bpod_event_times(rawsync, sync_map)
t_valve_open = bpod_intervals['valve_open'][:, 0]
res = t_valve_open.size > 1
except AssertionError:
res = False
Expand Down Expand Up @@ -569,42 +569,3 @@ def strictly_after(t0, t1, threshold):
qc_session = {k: np.all(qc_trials[k]) for k in qc_trials}

return qc_session, qc_trials


def _qc_from_path(sess_path, display=True):
WHEEL = False
sess_path = Path(sess_path)
temp_alf_folder = sess_path.joinpath('fpga_test', 'alf')
temp_alf_folder.mkdir(parents=True, exist_ok=True)

sync, chmap = ephys_fpga.get_main_probe_sync(sess_path, bin_exists=False)
_ = ephys_fpga.extract_all(sess_path, output_path=temp_alf_folder, save=True)
# check that the output is complete
fpga_trials, *_ = ephys_fpga.extract_behaviour_sync(sync, chmap=chmap, display=display)
# align with the bpod
bpod2fpga = ephys_fpga.align_with_bpod(temp_alf_folder.parent)
alf_trials = alfio.load_object(temp_alf_folder, 'trials')
shutil.rmtree(temp_alf_folder)
# do the QC
qcs, qct = qc_fpga_task(fpga_trials, alf_trials)

# do the wheel part
if WHEEL:
bpod_wheel = training_wheel.get_wheel_data(sess_path, save=False)
fpga_wheel = ephys_fpga.extract_wheel_sync(sync, chmap=chmap, save=False)

if display:
import matplotlib.pyplot as plt
t0 = max(np.min(bpod2fpga(bpod_wheel['re_ts'])), np.min(fpga_wheel['re_ts']))
dy = np.interp(t0, fpga_wheel['re_ts'], fpga_wheel['re_pos']) - np.interp(
t0, bpod2fpga(bpod_wheel['re_ts']), bpod_wheel['re_pos'])

fix, axes = plt.subplots(nrows=2, sharex='all', sharey='all')
# axes[0].plot(t, pos), axes[0].title.set_text('Extracted')
axes[0].plot(bpod2fpga(bpod_wheel['re_ts']), bpod_wheel['re_pos'] + dy)
axes[0].plot(fpga_wheel['re_ts'], fpga_wheel['re_pos'])
axes[0].title.set_text('FPGA')
axes[1].plot(bpod2fpga(bpod_wheel['re_ts']), bpod_wheel['re_pos'] + dy)
axes[1].title.set_text('Bpod')

return alfio.dataframe({**fpga_trials, **alf_trials, **qct})
Loading
Loading