Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added default factory to numpy color creation #106

Merged
merged 2 commits into from
Sep 24, 2023
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
6 changes: 3 additions & 3 deletions src/napari_arboretum/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import itertools
from collections import Counter
from dataclasses import dataclass
from dataclasses import dataclass, field
from typing import Any

import numpy as np
Expand All @@ -29,14 +29,14 @@ class Annotation:
x: float
y: float
label: str
color: ColorType = WHITE
color: ColorType = field(default_factory=lambda: WHITE)


@dataclass
class Edge:
x: tuple[float, float]
y: tuple[float, float]
color: ColorType = WHITE
color: ColorType = field(default_factory=lambda: WHITE)
track_id: int | None = None
node: TreeNode | None = None

Expand Down
Loading