Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/lineagetree/_core/_modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from collections.abc import Callable, Iterable
from functools import wraps
from typing import TYPE_CHECKING
import numpy as np

if TYPE_CHECKING:
from ..lineage_tree import LineageTree
Expand Down Expand Up @@ -96,7 +97,8 @@ def add_root(lT: LineageTree, t: int, pos: list | None = None) -> int:
lT._successor[C_next] = ()
lT._predecessor[C_next] = ()
lT._time[C_next] = t
lT.pos[C_next] = pos if isinstance(pos, list) else []
if isinstance(pos, (list, tuple)):
lT.pos[C_next] = np.array(pos)
Comment on lines +100 to +101
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I forgot but what we do that either all nodes have position or none but no in between

lT._changed_roots = True
return C_next

Expand Down
Loading