Skip to content

Commit 04a6038

Browse files
committed
refactor: throw on summary layer gen when features are not provided
1 parent 212ba57 commit 04a6038

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

tests/test_napari_layers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def test_branch_text_layer_has_text_config(
262262

263263
def test_summary_with_none_features_crashes(self, skeleton, graph, branch_data):
264264
config = ExtractionConfig(summary=True)
265-
with pytest.raises(AttributeError):
265+
with pytest.raises(ValueError, match="features is required"):
266266
extract_skeleton_layers(
267267
skeleton,
268268
"test",

vesskel/napari_layers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ def extract_skeleton_layers(
5656
layers.append(text_layer)
5757

5858
if config.summary:
59+
if features is None:
60+
raise ValueError(
61+
"features is required when summary is enabled"
62+
)
5963
summary_layer = _extract_summary_features_layer(
6064
skeleton,
6165
base_name,

0 commit comments

Comments
 (0)