Skip to content

Commit

Permalink
Remove unneeded imports, add cdel elif
Browse files Browse the repository at this point in the history
  • Loading branch information
CBroz1 committed Dec 15, 2023
1 parent b06fb07 commit 7544ed9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
2 changes: 0 additions & 2 deletions src/spyglass/common/signal_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import pynwb
import scipy.signal as signal

from spyglass.utils.dj_mixin import SpyglassMixin


def hilbert_decomp(lfp_band_object, sampling_rate=1):
"""generates the analytical decomposition of the signals in the lfp_band_object
Expand Down
6 changes: 1 addition & 5 deletions src/spyglass/decoding/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
from replay_trajectory_classification.observation_model import ObservationModel

from spyglass.common.common_behav import PositionIntervalMap, RawPosition
from spyglass.common.common_interval import (
IntervalList,
interval_list_intersect,
)
from spyglass.utils.dj_mixin import SpyglassMixin
from spyglass.common.common_interval import IntervalList, interval_list_intersect


def get_valid_ephys_position_times_from_interval(
Expand Down
1 change: 0 additions & 1 deletion src/spyglass/lfp/v1/lfp_artifact_difference_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
interval_from_inds,
interval_list_intersect,
)
from spyglass.utils.dj_mixin import SpyglassMixin
from spyglass.utils.nwb_helper_fn import get_valid_intervals


Expand Down
9 changes: 4 additions & 5 deletions src/spyglass/utils/dj_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,10 @@ def _delete_deps(self) -> list:
Used to delay import of tables until needed, avoiding circular imports.
"""
print("Getting delete deps")
if not self._delete_dependencies:
print("Importing delete deps")
from spyglass.common import LabMember, LabTeam, Session # noqa F401

self._delete_dependencies = [LabMember, LabTeam, Session]
print("Returning delete deps")
return self._delete_dependencies

@property
Expand Down Expand Up @@ -158,7 +155,7 @@ def _find_session(
if table: # table is link, will valid join to Session
break

else: # if no session ancestor found and limit reached
elif search_limit < 1: # if no session ancestor found and limit reached
return # Err kept in parent func to centralize permission logic

return table * Session
Expand Down Expand Up @@ -205,7 +202,9 @@ def _check_delete_permission(self) -> None:
for experimenter in set(experimenters):
if user_name not in LabTeam().get_team_members(experimenter):
raise PermissionError(
f"User {user_name} is not on a team with {experimenter}."
f"User '{user_name}' is not on a team with '{experimenter}'"
+ ", an experimenter for session(s):\n"
+ f"{sess * Session.Experimenter}"
)

# Rename to `delete` when we're ready to use it
Expand Down

0 comments on commit 7544ed9

Please sign in to comment.