Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix attribute retrieval from version-dependent icephys #264

Merged
merged 9 commits into from
Sep 23, 2022
Prev Previous commit
Next Next commit
actually swap to hasattr
CodyCBakerPhD committed Sep 20, 2022
commit a1ee11a8f6daf4f3386de5b15f5bdec1e32a58f0
2 changes: 1 addition & 1 deletion nwbinspector/checks/icephys.py
Original file line number Diff line number Diff line change
@@ -6,5 +6,5 @@
@register_check(importance=Importance.BEST_PRACTICE_VIOLATION, neurodata_type=IntracellularElectrode)
def check_intracellular_electrode_cell_id_exists(intracellular_electrode: IntracellularElectrode):
"""Check if the IntracellularElectrode contains a cell_id."""
if getattr(intracellular_electrode, "cell_id", "") is None: # Will only be None with PyNWB>=2.1.0
if hasattr(intracellular_electrode, "cell_id") and intracellular_electrode.cell_id is None:
return InspectorMessage(message="Please include a unique cell_id associated with this IntracellularElectrode.")