diff --git a/projects/_template.py b/projects/_template.py index 82bdaf7..fc32034 100644 --- a/projects/_template.py +++ b/projects/_template.py @@ -41,8 +41,7 @@ class TemplateBpodTrialsExtractor(BaseBpodTrialsExtractor): :class:`ibllib.io.extractors.mesoscope.TimelineTrials` for examples). To associate this extractor to your task protocol, you must add it to the - `projects/task_extractor_map.json` file. Additionally you can associate `Alyx procedures`_ (e.g. - 'Optical stimulation') to the protocol with the `projects/task_type_procedures.json` file. + `projects/task_extractor_map.json` file. .. _Alyx procedures: https://openalyx.internationalbrainlab.org/admin/actions/proceduretype/ diff --git a/projects/base.py b/projects/base.py deleted file mode 100644 index c9e5984..0000000 --- a/projects/base.py +++ /dev/null @@ -1,27 +0,0 @@ -from pathlib import Path -import logging -import importlib -import warnings - -from ibllib.pipes import tasks - -from ibllib.io.extractors.base import get_task_extractor_type -_logger = logging.getLogger('ibllib') - - -def get_pipeline(task_type) -> tasks.Pipeline: - """ - (DEPRECATED) Get the pipeline Task from task type - returns None if the task is not found. - - :param task_type: string that should match the module name - :return: - """ - warnings.warn('get_pipeline is deprecated. Use instructions in extraction_tasks.py instead.', DeprecationWarning) - if isinstance(task_type, Path): - task_type = get_task_extractor_type(task_type) - try: - mdl = importlib.import_module(f"projects.{task_type}") - except ModuleNotFoundError: - _logger.error({f"Import error: projects.{task_type} not found: does this project exist?"}) - return - return mdl.__pipeline__ diff --git a/projects/ephys_passive_opto.py b/projects/ephys_passive_opto.py index 102c63e..000be93 100644 --- a/projects/ephys_passive_opto.py +++ b/projects/ephys_passive_opto.py @@ -4,7 +4,7 @@ import one.alf.io as alfio from ibllib.io.extractors import ephys_fpga -from neurodsp.utils import sync_timestamps +from ibldsp.utils import sync_timestamps from ibllib.plots import squares, vertical_lines from ibllib.pipes import tasks diff --git a/projects/extractor_types.json b/projects/extractor_types.json deleted file mode 100644 index 5f54eff..0000000 --- a/projects/extractor_types.json +++ /dev/null @@ -1,6 +0,0 @@ -{"_bandit_laser_blocks_ephysChoiceWorld": "ephys_bandit", - "_bandit_biasedChoiceWorld": "training_bandit", - "_bandit_100_0_biasedChoiceWorld": "training_bandit", - "_bandit_shaping_100_0_biasedChoiceWorld": "training_bandit", - "FPChoiceWorld": "biased_fibrephotometry" -} diff --git a/projects/krasniak_widefield.py b/projects/krasniak_widefield.py index ef6dbd1..943aa4a 100644 --- a/projects/krasniak_widefield.py +++ b/projects/krasniak_widefield.py @@ -5,7 +5,7 @@ import numpy as np import ibllib.exceptions as err from ibllib.pipes.base_tasks import WidefieldTask -import neurodsp as dsp +import ibldsp as dsp import logging from one.api import ONE from ibllib.io.extractors.camera import get_video_length diff --git a/projects/task_type_procedures.json b/projects/task_type_procedures.json deleted file mode 100644 index 9a32d9f..0000000 --- a/projects/task_type_procedures.json +++ /dev/null @@ -1,4 +0,0 @@ -{"training_bandit": "Behavior training/tasks", - "ephys_bandit": "Ephys recording with acute probe(s)", - "biased_fibrephotometry": "Fiber photometry" -} diff --git a/projects/tests/test_biased_fibrephotometry.py b/projects/tests/test_biased_fibrephotometry.py index a0bb5b4..02a0b3b 100644 --- a/projects/tests/test_biased_fibrephotometry.py +++ b/projects/tests/test_biased_fibrephotometry.py @@ -1,7 +1,7 @@ +import unittest import shutil import numpy as np -import ibllib.pipes.training_preprocessing as tpp from projects import biased_fibrephotometry import one.alf.io as alfio from one.api import ONE @@ -10,6 +10,7 @@ from ci.tests import base +@unittest.skip('old pipeline no longer supported') class TestBiasedPhotometry(base.IntegrationTest): def setUp(self) -> None: @@ -32,6 +33,7 @@ def setUp(self) -> None: # link.symlink_to(ff) def test_extraction(self): + import ibllib.pipes.training_preprocessing as tpp # Extract the trials (required for photometry extraction) self.assertEqual( diff --git a/projects/tests/test_ephys_passive_opto.py b/projects/tests/test_ephys_passive_opto.py index ff8ccda..a46e6ec 100644 --- a/projects/tests/test_ephys_passive_opto.py +++ b/projects/tests/test_ephys_passive_opto.py @@ -1,3 +1,4 @@ +import unittest import shutil import numpy as np @@ -6,9 +7,8 @@ from one.api import ONE from ci.tests import base -from projects.ephys_passive_opto import EphysPassiveOptoTrials - +@unittest.skip('old pipeline no longer supported') class TestEphysPassiveOptoTrials(base.IntegrationTest): def setUp(self) -> None: @@ -21,6 +21,7 @@ def test_ephys_passive_opto(self): :return: """ session_path = self.session_path + from projects.ephys_passive_opto import EphysPassiveOptoTrials task = EphysPassiveOptoTrials(session_path=session_path, one=self.one_offline) task.run() diff --git a/projects/tests/test_ephys_training_bandit.py b/projects/tests/test_ephys_training_bandit.py index 1f780e5..2a23334 100644 --- a/projects/tests/test_ephys_training_bandit.py +++ b/projects/tests/test_ephys_training_bandit.py @@ -5,10 +5,8 @@ from ci.tests import base import unittest -from projects.training_bandit import extract_all as training_extract_all -from projects.ephys_bandit import extract_all as ephys_extract_all - +@unittest.skip('old pipeline no longer supported') class TestTrainingBanditTrials(base.IntegrationTest): def setUp(self) -> None: @@ -21,7 +19,7 @@ def test_training_bandit(self): Alejandro training bandit task :return: """ - + from projects.training_bandit import extract_all as training_extract_all trials, _, _ = training_extract_all(self.session_path, save=False) trials_orig = alfio.load_object(self.session_path.joinpath('alf'), object='trials') @@ -32,6 +30,7 @@ def test_training_bandit(self): assert np.array_equal(trials['table']['contrastRight'], trials_orig['contrastRight']) +@unittest.skip('old pipeline no longer supported') class TestEphysBanditTrials(base.IntegrationTest): @unittest.skip("Skip FTP upload test") @@ -44,7 +43,7 @@ def test_ephys_bandit(self): Alejandro ephys bandit task :return: """ - + from projects.ephys_bandit import extract_all as ephys_extract_all trials, _ = ephys_extract_all(self.session_path, save=False) trials_orig = alfio.load_object(self.session_path.joinpath('alf'), object='trials') diff --git a/pyproject.toml b/pyproject.toml index 0387828..797da0e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "project_extraction" -version = "0.2.7" +version = "0.3.0" description = "Custom extractors for satellite tasks" dynamic = [ "readme" ] keywords = [ "IBL", "neuro-science" ]