Skip to content
Merged
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
3 changes: 2 additions & 1 deletion labdata_plugin/analysisschema.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ class PsychophysicalKernel(dj.Computed):
def key_source(self):
subject_conditions = (
dj.U("analysis_set_id", "subject_name", "trialset_description")
& BehaviorAnalysisSet.TrialSet()
.aggr(BehaviorAnalysisSet.TrialSet(), n_trialsets="count(*)")
.proj()
)
return subject_conditions * PsychophysicalKernelFitConfig()

Expand Down
18 changes: 8 additions & 10 deletions src/behavior_analyses/kernel_timing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

from importlib import import_module
from typing import Any

import numpy as np
Expand Down Expand Up @@ -339,18 +338,17 @@ def _fetch_chipmunk_trial_rows(dataset_key: dict[str, Any]) -> list[dict[str, An
def _fetch_event_mapping_rows(
session_key: dict[str, Any],
) -> list[dict[str, Any]]:
try:
import labdata
import datajoint as dj
import labdata
from labdata.schema import get_user_schema

labdata.plugins["gephys"].__file__
module = import_module("gephys.analysisschema")
try:
labdata.plugins["gephys"]
except KeyError:
return []
except ModuleNotFoundError as error:
if error.name in {"gephys", "gephys.analysisschema"}:
return []
raise
return list((module.EventMapping() & session_key).fetch(as_dict=True))
schema = get_user_schema()
table = dj.FreeTable(schema.connection, f"`{schema.database}`.`event_mapping`")
return list((table & session_key).fetch(as_dict=True))


def _fetch_mapped_digital_event_rows(
Expand Down
Loading