From 5baebeb641c41fbef6761d0c5a3aa9a8819b5fe1 Mon Sep 17 00:00:00 2001 From: Yohsuke Fukai Date: Fri, 14 Oct 2022 15:58:41 +0900 Subject: [PATCH 1/2] fixed data conversion bug --- src/laptrack/data_conversion.py | 4 ++-- tests/test_tracking.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/laptrack/data_conversion.py b/src/laptrack/data_conversion.py index 5fe18e98..1f333e91 100644 --- a/src/laptrack/data_conversion.py +++ b/src/laptrack/data_conversion.py @@ -209,8 +209,8 @@ def convert_tree_to_dataframe( splits.append((node, children)) if len(parents) > 1: for parent in parents: - if tree2.has_edge(node, parent): - tree2.remove_edge(node, parent) + if tree2.has_edge(parent, node): + tree2.remove_edge(parent, node) if node not in [p[0] for p in merges]: merges.append((node, parents)) diff --git a/tests/test_tracking.py b/tests/test_tracking.py index 06f67db4..a66e81a0 100644 --- a/tests/test_tracking.py +++ b/tests/test_tracking.py @@ -127,6 +127,8 @@ def test_reproducing_trackmate(testdata, tracker_class) -> None: ) df = pd.concat(data) track_df, split_df, merge_df = lt.predict_dataframe(df, ["x", "y"]) + assert not any(split_df.duplicated()) + assert not any(merge_df.duplicated()) track_df2, split_df2, merge_df2 = convert_tree_to_dataframe(track_tree, coords) track_df2 = track_df2.rename(columns={"coord-0": "x", "coord-1": "y"}) assert all(track_df == track_df2) From 7aeb9266e40518369a5dc5618570cf65ebec069d Mon Sep 17 00:00:00 2001 From: Yohsuke Fukai Date: Fri, 14 Oct 2022 16:01:23 +0900 Subject: [PATCH 2/2] bumped minor --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0cbb00cc..6c4cdf73 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "laptrack" -version = "0.5.1" +version = "0.6.0" description = "LapTrack" authors = ["Yohsuke Fukai "] license = "BSD-3-Clause"