Skip to content
Snippets Groups Projects
Commit ab1c441d authored by Maeva Pourpoint's avatar Maeva Pourpoint
Browse files

Add method "update_electrode_info" to replace inner loop in "update_array" method

parent a1865409
No related branches found
No related tags found
1 merge request!4Data handling functionalities
Pipeline #1367 passed with stage
in 5 minutes and 31 seconds
......@@ -249,10 +249,17 @@ class LemiData():
# Update component, channel_name and location code for electric channels
e_loc = get_e_loc(e_info)
for key, val in e_info.items():
for ind in np.where(self.data_np['channel_number'] == key)[0]:
self.data_np[ind]['component'] = val
self.data_np[ind]['channel_name'] = CHANNEL_NAMING_CONVENTION[val]
self.data_np[ind]['location'] = e_loc.get(key, '')
self.update_electrode_info(key, val, e_loc)
def update_electrode_info(self, key: str, val: str, e_loc: Dict) -> None:
"""
Update electrode info (component, channel_name and location code) in
data_np attribute.
"""
for ind in np.where(self.data_np['channel_number'] == key)[0]:
self.data_np[ind]['component'] = val
self.data_np[ind]['channel_name'] = CHANNEL_NAMING_CONVENTION[val]
self.data_np[ind]['location'] = e_loc.get(key, '')
def update_data(self, qc_inputs: Optional[Dict] = None,
metadata=None) -> None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment