Skip to content

Commit

Permalink
Fix notebook v0/v1 imports
Browse files Browse the repository at this point in the history
  • Loading branch information
edeno committed Jan 26, 2024
1 parent 05de869 commit 59ee34a
Show file tree
Hide file tree
Showing 9 changed files with 155 additions and 149 deletions.
60 changes: 30 additions & 30 deletions notebooks/10_Spike_SortingV0.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
}
],
"source": [
"sgs.SortGroup().set_group_by_shank(nwb_file_name)"
"sgs.v0.SortGroup().set_group_by_shank(nwb_file_name)"
]
},
{
Expand Down Expand Up @@ -423,7 +423,7 @@
}
],
"source": [
"sgs.SortGroup.SortGroupElectrode & {\"nwb_file_name\": nwb_file_name}"
"sgs.v0.SortGroup.SortGroupElectrode & {\"nwb_file_name\": nwb_file_name}"
]
},
{
Expand Down Expand Up @@ -625,7 +625,7 @@
"metadata": {},
"outputs": [],
"source": [
"sgs.SortInterval.insert1(\n",
"sgs.v0.SortInterval.insert1(\n",
" {\n",
" \"nwb_file_name\": nwb_file_name,\n",
" \"sort_interval_name\": sort_interval_name,\n",
Expand Down Expand Up @@ -658,7 +658,7 @@
"source": [
"print_interval_duration(\n",
" (\n",
" sgs.SortInterval\n",
" sgs.v0.SortInterval\n",
" & {\n",
" \"nwb_file_name\": nwb_file_name,\n",
" \"sort_interval_name\": sort_interval_name,\n",
Expand Down Expand Up @@ -772,7 +772,7 @@
}
],
"source": [
"sgs.SpikeSortingPreprocessingParameters()"
"sgs.v0.SpikeSortingPreprocessingParameters()"
]
},
{
Expand All @@ -796,9 +796,9 @@
}
],
"source": [
"sgs.SpikeSortingPreprocessingParameters().insert_default()\n",
"sgs.v0.SpikeSortingPreprocessingParameters().insert_default()\n",
"preproc_params = (\n",
" sgs.SpikeSortingPreprocessingParameters()\n",
" sgs.v0.SpikeSortingPreprocessingParameters()\n",
" & {\"preproc_params_name\": \"default\"}\n",
").fetch1(\"preproc_params\")\n",
"print(preproc_params)"
Expand All @@ -819,7 +819,7 @@
"outputs": [],
"source": [
"preproc_params[\"frequency_min\"] = 600\n",
"sgs.SpikeSortingPreprocessingParameters().insert1(\n",
"sgs.v0.SpikeSortingPreprocessingParameters().insert1(\n",
" {\n",
" \"preproc_params_name\": \"default_hippocampus\",\n",
" \"preproc_params\": preproc_params,\n",
Expand Down Expand Up @@ -991,8 +991,8 @@
}
],
"source": [
"sgs.SpikeSortingRecordingSelection.insert1(ssr_key, skip_duplicates=True)\n",
"sgs.SpikeSortingRecordingSelection() & ssr_key"
"sgs.v0.SpikeSortingRecordingSelection.insert1(ssr_key, skip_duplicates=True)\n",
"sgs.v0.SpikeSortingRecordingSelection() & ssr_key"
]
},
{
Expand Down Expand Up @@ -1039,8 +1039,8 @@
}
],
"source": [
"ssr_pk = (sgs.SpikeSortingRecordingSelection & ssr_key).proj()\n",
"sgs.SpikeSortingRecording.populate([ssr_pk])"
"ssr_pk = (sgs.v0.SpikeSortingRecordingSelection & ssr_key).proj()\n",
"sgs.v0.SpikeSortingRecording.populate([ssr_pk])"
]
},
{
Expand Down Expand Up @@ -1160,7 +1160,7 @@
}
],
"source": [
"sgs.SpikeSortingRecording() & ssr_key"
"sgs.v0.SpikeSortingRecording() & ssr_key"
]
},
{
Expand All @@ -1183,8 +1183,8 @@
"metadata": {},
"outputs": [],
"source": [
"sgs.ArtifactDetectionParameters().insert_default()\n",
"artifact_key = (sgs.SpikeSortingRecording() & ssr_key).fetch1(\"KEY\")\n",
"sgs.v0.ArtifactDetectionParameters().insert_default()\n",
"artifact_key = (sgs.v0.SpikeSortingRecording() & ssr_key).fetch1(\"KEY\")\n",
"artifact_key[\"artifact_params_name\"] = \"none\""
]
},
Expand Down Expand Up @@ -1307,8 +1307,8 @@
}
],
"source": [
"sgs.ArtifactDetectionSelection().insert1(artifact_key)\n",
"sgs.ArtifactDetectionSelection() & artifact_key"
"sgs.v0.ArtifactDetectionSelection().insert1(artifact_key)\n",
"sgs.v0.ArtifactDetectionSelection() & artifact_key"
]
},
{
Expand All @@ -1333,7 +1333,7 @@
}
],
"source": [
"sgs.ArtifactDetection.populate(artifact_key)"
"sgs.v0.ArtifactDetection.populate(artifact_key)"
]
},
{
Expand Down Expand Up @@ -1461,7 +1461,7 @@
}
],
"source": [
"sgs.ArtifactRemovedIntervalList() & artifact_key"
"sgs.v0.ArtifactRemovedIntervalList() & artifact_key"
]
},
{
Expand Down Expand Up @@ -1494,12 +1494,12 @@
}
],
"source": [
"sgs.SpikeSorterParameters().insert_default()\n",
"sgs.v0.SpikeSorterParameters().insert_default()\n",
"\n",
"# Let's look at the default params\n",
"sorter_name = \"mountainsort4\"\n",
"ms4_default_params = (\n",
" sgs.SpikeSorterParameters\n",
" sgs.v0.SpikeSorterParameters\n",
" & {\"sorter\": sorter_name, \"sorter_params_name\": \"default\"}\n",
").fetch1()\n",
"print(ms4_default_params)"
Expand Down Expand Up @@ -1599,7 +1599,7 @@
],
"source": [
"sorter_params_name = \"hippocampus_tutorial\"\n",
"sgs.SpikeSorterParameters.insert1(\n",
"sgs.v0.SpikeSorterParameters.insert1(\n",
" {\n",
" \"sorter\": sorter_name,\n",
" \"sorter_params_name\": sorter_params_name,\n",
Expand All @@ -1608,7 +1608,7 @@
" skip_duplicates=True,\n",
")\n",
"(\n",
" sgs.SpikeSorterParameters\n",
" sgs.v0.SpikeSorterParameters\n",
" & {\"sorter\": sorter_name, \"sorter_params_name\": sorter_params_name}\n",
").fetch1()"
]
Expand Down Expand Up @@ -1652,8 +1652,8 @@
],
"source": [
"ss_key = dict(\n",
" **(sgs.ArtifactDetection & ssr_key).fetch1(\"KEY\"),\n",
" **(sgs.ArtifactRemovedIntervalList() & ssr_key).fetch1(\"KEY\"),\n",
" **(sgs.v0.ArtifactDetection & ssr_key).fetch1(\"KEY\"),\n",
" **(sgs.v0.ArtifactRemovedIntervalList() & ssr_key).fetch1(\"KEY\"),\n",
" sorter=sorter_name,\n",
" sorter_params_name=sorter_params_name,\n",
")\n",
Expand Down Expand Up @@ -1779,8 +1779,8 @@
}
],
"source": [
"sgs.SpikeSortingSelection.insert1(ss_key, skip_duplicates=True)\n",
"(sgs.SpikeSortingSelection & ss_key)"
"sgs.v0.SpikeSortingSelection.insert1(ss_key, skip_duplicates=True)\n",
"(sgs.v0.SpikeSortingSelection & ss_key)"
]
},
{
Expand Down Expand Up @@ -2267,7 +2267,7 @@
],
"source": [
"# [(sgs.SpikeSortingSelection & ss_key).proj()]\n",
"sgs.SpikeSorting.populate()"
"sgs.v0.SpikeSorting.populate()"
]
},
{
Expand Down Expand Up @@ -2399,7 +2399,7 @@
}
],
"source": [
"sgs.SpikeSorting() & ss_key"
"sgs.v0.SpikeSorting() & ss_key"
]
},
{
Expand Down Expand Up @@ -2429,7 +2429,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.16"
"version": "3.9.18"
},
"vscode": {
"interpreter": {
Expand Down
Loading

0 comments on commit 59ee34a

Please sign in to comment.