Skip to content
Snippets Groups Projects
Commit 74a72920 authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Ignore missing sources when finding memory cell patterns

parent b69bde07
No related branches found
No related tags found
1 merge request!1114[LPD] [Correct] Ignore missing sources when finding memory cell patterns
...@@ -4,7 +4,7 @@ from typing import Optional ...@@ -4,7 +4,7 @@ from typing import Optional
from warnings import warn from warnings import warn
import numpy as np import numpy as np
from extra_data import RunDirectory from extra_data import RunDirectory, SourceNameError
def get_mem_cell_pattern(run, sources) -> np.ndarray: def get_mem_cell_pattern(run, sources) -> np.ndarray:
...@@ -15,7 +15,11 @@ def get_mem_cell_pattern(run, sources) -> np.ndarray: ...@@ -15,7 +15,11 @@ def get_mem_cell_pattern(run, sources) -> np.ndarray:
""" """
patterns = [] patterns = []
for source in sources: for source in sources:
cell_id_data = run[source, 'image.cellId'].drop_empty_trains() try:
cell_id_data = run[source, 'image.cellId'].drop_empty_trains()
except SourceNameError:
continue # Source missing
if len(cell_id_data.train_ids) == 0: if len(cell_id_data.train_ids) == 0:
continue # No data for this module continue # No data for this module
cell_ids = cell_id_data[0].ndarray().flatten() cell_ids = cell_id_data[0].ndarray().flatten()
......
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