Skip to content
Snippets Groups Projects
Commit ae45a7c8 authored by Alán Muñoz's avatar Alán Muñoz
Browse files

fix for non-unique post-merge cases

parent 4ad45623
No related branches found
No related tags found
No related merge requests found
...@@ -258,7 +258,9 @@ class PostProcessor: ...@@ -258,7 +258,9 @@ class PostProcessor:
indices[search(indices, source)] = target indices[search(indices, source)] = target
self.lineage_merged = pd.MultiIndex.from_arrays( self.lineage_merged = pd.MultiIndex.from_arrays(
(np.append(mothers, daughters[:, 1].reshape(-1, 1), axis=1).T), np.unique(
np.append(mothers, daughters[:, 1].reshape(-1, 1), axis=1), axis=0
).T,
names=["trap", "mother_label", "daughter_label"], names=["trap", "mother_label", "daughter_label"],
) )
self._writer.write( self._writer.write(
...@@ -270,7 +272,8 @@ class PostProcessor: ...@@ -270,7 +272,8 @@ class PostProcessor:
self._writer.write( self._writer.write(
"modifiers/picks", "modifiers/picks",
data=pd.MultiIndex.from_arrays( data=pd.MultiIndex.from_arrays(
indices.T if indices.any() else [[], []], # FIXME there seem to be repeated indices, it should not be the case
np.unique(indices, axis=0).T if indices.any() else [[], []],
names=["trap", "cell_label"], names=["trap", "cell_label"],
), ),
overwrite="overwrite", overwrite="overwrite",
...@@ -360,7 +363,7 @@ class PostProcessor: ...@@ -360,7 +363,7 @@ class PostProcessor:
outpath = "/postprocessing/" + process + "/" + outpath outpath = "/postprocessing/" + process + "/" + outpath
if isinstance(result, dict): # Multiple Signals as output if isinstance(result, dict): # Multiple Signals as output
for k, v in result: for k, v in result.items():
self.write_result( self.write_result(
outpath + f"/{k}", outpath + f"/{k}",
v, v,
......
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