Skip to content

Commit

Permalink
Fix SpikeSortingOutput get_recording and get_sorting (#761)
Browse files Browse the repository at this point in the history
* Avoid merge restrict
  • Loading branch information
edeno authored Jan 12, 2024
1 parent 499edac commit 582a09c
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions src/spyglass/spikesorting/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,16 @@ class CuratedSpikeSorting(SpyglassMixin, dj.Part): # noqa: F811

def get_recording(cls, key):
"""get the recording associated with a spike sorting output"""
recording_key = cls.merge_restrict(key).proj()
query = (
source_class_dict[
to_camel_case(cls.merge_get_parent(key).table_name)
]
& recording_key
)
return query.get_recording(recording_key)
source_table = source_class_dict[
to_camel_case(cls.merge_get_parent(key).table_name)
]
query = source_table & cls.merge_get_part(key)
return query.get_recording(query.fetch("KEY"))

def get_sorting(cls, key):
"""get the sorting associated with a spike sorting output"""
sorting_key = cls.merge_restrict(key).proj()
query = (
source_class_dict[
to_camel_case(cls.merge_get_parent(key).table_name)
]
& sorting_key
)
return query.get_sorting(sorting_key)
source_table = source_class_dict[
to_camel_case(cls.merge_get_parent(key).table_name)
]
query = source_table & cls.merge_get_part(key)
return query.get_sorting(query.fetch("KEY"))

0 comments on commit 582a09c

Please sign in to comment.