Skip to content

Commit

Permalink
Merge pull request #207 from yfukai/fix_data_conversion_bug
Browse files Browse the repository at this point in the history
Fixed data conversion bug
  • Loading branch information
yfukai authored Oct 14, 2022
2 parents 8ccb4c1 + 7aeb926 commit eb7cbf7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "laptrack"
version = "0.5.1"
version = "0.6.0"
description = "LapTrack"
authors = ["Yohsuke Fukai <ysk@yfukai.net>"]
license = "BSD-3-Clause"
Expand Down
4 changes: 2 additions & 2 deletions src/laptrack/data_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
2 changes: 2 additions & 0 deletions tests/test_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit eb7cbf7

Please sign in to comment.