Skip to content

Commit 1b67629

Browse files
committed
import from workflow pipeline
1 parent eb47ee5 commit 1b67629

File tree

1 file changed

+14
-6
lines changed
  • element_array_ephys/export/nwb

1 file changed

+14
-6
lines changed

element_array_ephys/export/nwb/nwb.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
from tqdm import tqdm
1616
from uuid import uuid4
1717

18-
from ... import ephys
18+
#from ... import ephys
1919

20-
# from workflow.pipeline import ephys
20+
from workflow.pipeline import ephys
2121

2222

2323
class DecimalEncoder(json.JSONEncoder):
@@ -112,8 +112,12 @@ def add_electrodes_to_nwb(session_key: dict, nwbfile: pynwb.NWBFile):
112112
insertion_record = (ephys.InsertionLocation & this_probe).fetch1()
113113
if insertion_record:
114114
insert_location = json.dumps(
115-
{k: v for k, v in insertion_record.items() if k not in ephys.InsertionLocation.primary_key},
116-
cls=DecimalEncoder
115+
{
116+
k: v
117+
for k, v in insertion_record.items()
118+
if k not in ephys.InsertionLocation.primary_key
119+
},
120+
cls=DecimalEncoder,
117121
)
118122
else:
119123
insert_location = "unknown"
@@ -332,7 +336,9 @@ def add_ephys_recording_to_nwb(
332336
):
333337
probe_id = (ephys.ProbeInsertion() & ephys_recording_record).fetch1("probe")
334338

335-
relative_path = (ephys.EphysRecording.EphysFile & ephys_recording_record).fetch1("file_path")
339+
relative_path = (
340+
ephys.EphysRecording.EphysFile & ephys_recording_record
341+
).fetch1("file_path")
336342
file_path = ephys.find_full_path(get_ephys_root_data_dir(), relative_path)
337343

338344
if ephys_recording_record["acq_software"] == "SpikeGLX":
@@ -457,7 +463,9 @@ def add_ephys_lfp_from_source_to_nwb(
457463
):
458464
probe_id = (ephys.ProbeInsertion() & ephys_recording_record).fetch1("probe")
459465

460-
relative_path = (ephys.EphysRecording.EphysFile & ephys_recording_record).fetch1("file_path")
466+
relative_path = (
467+
ephys.EphysRecording.EphysFile & ephys_recording_record
468+
).fetch1("file_path")
461469
file_path = find_full_path(ephys.get_ephys_root_data_dir(), relative_path)
462470

463471
if ephys_recording_record["acq_software"] == "SpikeGLX":

0 commit comments

Comments
 (0)