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

Remove old delete method from SpikeSorting table of V0 pipeline #751

Merged
merged 21 commits into from
Jan 8, 2024
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0752b16
Save LFP as pynwb.ecephys.LFP
khl02007 May 10, 2023
9fb9d7b
Fix formatting
edeno May 10, 2023
5243b21
Fix formatting
edeno May 10, 2023
fc9eac7
Merge branch 'master' of https://github.com/LorenFrankLab/spyglass
khl02007 May 11, 2023
bf7487a
Merge branch 'master' of https://github.com/LorenFrankLab/spyglass
khl02007 May 13, 2023
6a876fd
Merge branch 'master' of https://github.com/LorenFrankLab/spyglass
khl02007 May 21, 2023
fba7523
Merge branch 'master' of https://github.com/LorenFrankLab/spyglass
khl02007 May 22, 2023
2ff1a5f
Merge branch 'master' of https://github.com/LorenFrankLab/spyglass
khl02007 Jun 2, 2023
128a0a8
Merge branch 'master' of https://github.com/LorenFrankLab/spyglass
khl02007 Jun 5, 2023
75930cd
Merge branch 'master' of https://github.com/LorenFrankLab/spyglass
khl02007 Jun 20, 2023
476ee6d
Merge branch 'master' of https://github.com/LorenFrankLab/spyglass
khl02007 Jul 23, 2023
ecc3a0c
Merge branch 'master' of https://github.com/LorenFrankLab/spyglass
khl02007 Jul 24, 2023
2834d26
Merge branch 'master' of https://github.com/LorenFrankLab/spyglass
khl02007 Aug 2, 2023
379c904
Merge branch 'master' of https://github.com/LorenFrankLab/spyglass
khl02007 Aug 7, 2023
520c587
Merge branch 'master' of https://github.com/LorenFrankLab/spyglass
khl02007 Sep 21, 2023
b9d6b29
Merge branch 'master' of https://github.com/LorenFrankLab/spyglass
khl02007 Nov 29, 2023
0cadc41
Merge branch 'master' of https://github.com/LorenFrankLab/spyglass
khl02007 Dec 11, 2023
08b23cd
Merge branch 'master' of https://github.com/LorenFrankLab/spyglass
khl02007 Dec 15, 2023
405dc06
Merge branch 'master' of https://github.com/LorenFrankLab/spyglass
khl02007 Dec 20, 2023
d607d92
Merge branch 'master' of https://github.com/LorenFrankLab/spyglass
khl02007 Jan 7, 2024
ced22a7
Remove old delete from SSv0
khl02007 Jan 7, 2024
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
43 changes: 0 additions & 43 deletions src/spyglass/spikesorting/spikesorting_sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,49 +240,6 @@ def make(self, key: dict):
sorting = sorting.save(folder=key["sorting_path"])
self.insert1(key)

def delete(self):
"""Extends the delete method of base class to implement permission
checking. Note that this is NOT a security feature, as anyone that has
access to source code can disable it; it just makes it less likely to
accidentally delete entries."""

current_user_name = dj.config["database.user"]
entries = self.fetch()
permission_bool = np.zeros((len(entries),))
logger.info(
f"Attempting to delete {len(entries)} entries, checking permission..."
)

for entry_idx in range(len(entries)):
# check the team name for the entry, then look up the members in that team,
# then get their datajoint user names
team_name = (
SpikeSortingRecordingSelection
& (SpikeSortingRecordingSelection & entries[entry_idx]).proj()
).fetch1()["team_name"]
lab_member_name_list = (
LabTeam.LabTeamMember & {"team_name": team_name}
).fetch("lab_member_name")
datajoint_user_names = []
for lab_member_name in lab_member_name_list:
datajoint_user_names.append(
(
LabMember.LabMemberInfo
& {"lab_member_name": lab_member_name}
).fetch1("datajoint_user_name")
)
permission_bool[entry_idx] = (
current_user_name in datajoint_user_names
)
if np.sum(permission_bool) == len(entries):
logger.info("Permission to delete all specified entries granted.")
super().delete()
else:
raise Exception(
"You do not have permission to delete all specified"
"entries. Not deleting anything."
)

def fetch_nwb(self, *attrs, **kwargs):
raise NotImplementedError
return None
Expand Down