Skip to content
This repository was archived by the owner on Dec 8, 2023. It is now read-only.

Workshop Docker image #22

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions .datajoint_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"database.host": "tutorial-db.datajoint.io",
"database.port": 3306,
"database.reconnect": true,
"connection.init_function": null,
"connection.charset": "",
"loglevel": "INFO",
"safemode": true,
"fetch_format": "array",
"display.limit": 12,
"display.width": 14,
"display.show_tuple_count": true,
"database.use_tls": null,
"enable_python_native_blobs": true
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,6 @@ Diagram.ipynb

# vscode
.vscode/settings.json

# Mac
.DS_Store
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
datajoint>=0.13.0
element-array-ephys
element-lab
element-animal
element-session
ipykernel
element-array-ephys
element-lab
element-animal
element-session
ipykernel
23 changes: 16 additions & 7 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

# ------------------- SOME CONSTANTS -------------------

_tear_down = True

test_user_data_dir = pathlib.Path('./tests/user_data')
test_user_data_dir.mkdir(exist_ok=True)

Expand Down Expand Up @@ -84,7 +86,8 @@ def pipeline():
'session': pipeline.session,
'get_ephys_root_data_dir': pipeline.get_ephys_root_data_dir}

pipeline.subject.Subject.delete()
if _tear_down:
pipeline.subject.Subject.delete()


@pytest.fixture
Expand Down Expand Up @@ -197,7 +200,8 @@ def kilosort_paramset(pipeline):

yield params_ks

(ephys.ClusteringParamSet & 'paramset_idx = 0').delete()
if _tear_down:
(ephys.ClusteringParamSet & 'paramset_idx = 0').delete()


@pytest.fixture
Expand All @@ -208,7 +212,8 @@ def ephys_recordings(pipeline, ingest_sessions):

yield

ephys.EphysRecording.delete()
if _tear_down:
ephys.EphysRecording.delete()


@pytest.fixture
Expand All @@ -225,11 +230,13 @@ def clustering_tasks(pipeline, kilosort_paramset, ephys_recordings):
kilosort_dir = next(recording_dir.rglob('spike_times.npy')).parent
ephys.ClusteringTask.insert1({**ephys_rec_key,
'paramset_idx': 0,
'clustering_output_dir': kilosort_dir.as_posix()})
'clustering_output_dir': kilosort_dir.as_posix()},
skip_duplicates=True)

yield

ephys.ClusteringTask.delete()
if _tear_down:
ephys.ClusteringTask.delete()


@pytest.fixture
Expand All @@ -240,7 +247,8 @@ def clustering(clustering_tasks, pipeline):

yield

ephys.Clustering.delete()
if _tear_down:
ephys.Clustering.delete()


@pytest.fixture
Expand All @@ -252,4 +260,5 @@ def curations(clustering, pipeline):

yield

ephys.Curation.delete()
if _tear_down:
ephys.Curation.delete()
2 changes: 1 addition & 1 deletion workflow_array_ephys/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def ingest_sessions(session_csv_path='./user_data/sessions.csv'):
root_data_dir = get_ephys_root_data_dir()

# ---------- Insert new "Session" and "ProbeInsertion" ---------
with open(session_csv_path, newline= '') as f:
with open(session_csv_path, newline='') as f:
input_sessions = list(csv.DictReader(f, delimiter=','))

# Folder structure: root / subject / session / probe / .ap.meta
Expand Down
1 change: 1 addition & 0 deletions workflow_array_ephys/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

subject.activate(db_prefix + 'subject', linking_module=__name__)

Experimenter = lab.User
session.activate(db_prefix + 'session', linking_module=__name__)

# ----------- Declare table SkullReference for use in element-array-ephys ---------
Expand Down