Skip to content

Fix Lineage.__repr__#1366

Merged
Marius1311 merged 2 commits into
scverse:mainfrom
eroell:fix/lineage-repr-numpy-2.4
Jun 19, 2026
Merged

Fix Lineage.__repr__#1366
Marius1311 merged 2 commits into
scverse:mainfrom
eroell:fix/lineage-repr-numpy-2.4

Conversation

@eroell

@eroell eroell commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Updated Lineage.__repr__

Now

import numpy as np
from cellrank import Lineage

L = Lineage(
    np.array([[0.6, 0.4], [0.3, 0.7], [0.9, 0.1]]),
    names=["foo", "bar"],
    colors=["#ff0000", "#0000ff"],
)

print(L)

yields

[[0.6 0.4]
 [0.3 0.7]
 [0.9 0.1]]
 names=[foo, bar]

Bug fixes

@Marius1311

Copy link
Copy Markdown
Collaborator

Looks good, thanks!

@Marius1311 Marius1311 merged commit 4719939 into scverse:main Jun 19, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lineage.__repr__ / __str__ raise TypeError on numpy >= 2.4 ("only 0-dimensional arrays can be converted to Python scalars")

2 participants