Skip to content

Commit 6088f60

Browse files
authored
Apply suggestions from code review
1 parent 127860e commit 6088f60

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

src/jdb_to_nwb/convert_photometry.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ def import_ppd(ppd_file_path):
417417
data_dict.update(header_dict)
418418
return data_dict
419419

420-
def process_ppd_photometry(ppd_file_path, nwbfile: NWBFile, metadata: dict):
420+
def process_ppd_photometry(nwbfile: NWBFile, ppd_file_path):
421421
"""
422422
Process pyPhotometry data from a .ppd file and add the processed signals to the NWB file.
423423
"""
@@ -455,11 +455,7 @@ def process_ppd_photometry(ppd_file_path, nwbfile: NWBFile, metadata: dict):
455455
zscored_405 = np.divide(np.subtract(highpass_405,highpass_405.mean()),highpass_405.std())
456456

457457
ratio_zscored = np.divide(np.subtract(ratio_highpass,ratio_highpass.mean()),ratio_highpass.std())
458-
print('Done processing photometry data! Returning z-scored signals...')
459-
460-
# Add photometry metadata to the NWB
461-
print("Adding photometry metadata to NWB ...")
462-
add_photometry_metadata(NWBFile, metadata)
458+
print('Done processing photometry data!')
463459

464460
# Add actual photometry data to the NWB
465461
print("Adding photometry signals to NWB ...")
@@ -538,8 +534,7 @@ def process_ppd_photometry(ppd_file_path, nwbfile: NWBFile, metadata: dict):
538534
nwbfile.add_acquisition(z_scored_565_response_series)
539535
nwbfile.add_acquisition(z_scored_ratio_response_series)
540536

541-
# Return port visits in downsampled photometry time (250 Hz) to use for alignment
542-
537+
# Return port visits in downsampled photometry time (86 Hz) to use for alignment
543538
return sampling_rate, visits
544539

545540

@@ -602,11 +597,7 @@ def add_photometry(nwbfile: NWBFile, metadata: dict):
602597
# Process ppd file from pyPhotometry
603598
print("Processing ppd file from pyPhotometry...")
604599
ppd_file_path = metadata["photometry"]["ppd_file_path"]
605-
signals = process_ppd_photometry(ppd_file_path)
606-
# TODO for Jose - add pyPhotometry processing here!!
607-
# Probably add the processing functions above and just call them here
608-
609-
raise NotImplementedError("pyPhotometry processing is not yet implemented.")
600+
sampling_rate, visits = process_ppd_photometry(nwbfile, ppd_file_path)
610601

611602
else:
612603
raise ValueError(

0 commit comments

Comments
 (0)