Skip to content

Commit

Permalink
Check existence of optional fields during Electrode table population (
Browse files Browse the repository at this point in the history
LorenFrankLab#985)

* Separate optional fields

* Provide default for filtering

* Black

* Use get
  • Loading branch information
khl02007 authored May 21, 2024
1 parent 26e74a4 commit ae4a7b8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/spyglass/common/common_ephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def make(self, key):
"""Make without transaction
Allows populate_all_common to work within a single transaction."""

nwb_file_name = key["nwb_file_name"]
nwb_file_abspath = Nwbfile.get_abs_path(nwb_file_name)
nwbf = get_nwb_file(nwb_file_abspath)
Expand Down Expand Up @@ -132,10 +133,10 @@ def make(self, key):
"region_id": BrainRegion.fetch_add(
region_name=elect_data.group.location
),
"x": elect_data.x,
"y": elect_data.y,
"z": elect_data.z,
"filtering": elect_data.filtering,
"x": elect_data.get("x"),
"y": elect_data.get("y"),
"z": elect_data.get("z"),
"filtering": elect_data.get("filtering", "unfiltered"),
"impedance": elect_data.get("imp"),
**electrode_constants,
}
Expand Down

0 comments on commit ae4a7b8

Please sign in to comment.