Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@ dependencies = [
"numpy",
"dask",
"pyyaml",
"networkx", # also a transitive dependency of scikit-image, from napari
]

[project.optional-dependencies]
# Allow easily installation with the full, default napari installation
# (including Qt backend) using ndev-workflows[all].
all = ["napari[all]"]
# Optional visualization dependencies for the workflow inspector graph view
plot = ["matplotlib"]

[dependency-groups]
dev = [
Expand Down
20 changes: 20 additions & 0 deletions src/ndev_workflows/_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,26 @@ def undo_redo(self) -> UndoRedoController:
"""The undo/redo controller."""
return self._undo_redo

@property
def pending_updates(self) -> list[str]:
"""List of task names pending update (read-only copy)."""
return list(self._pending_updates)

def is_layer_pending(self, name: str) -> bool:
"""Check if a layer/task is pending update.

Parameters
----------
name : str
The task name to check.

Returns
-------
bool
True if the task is scheduled for update.
"""
return name in self._pending_updates

def update(
self,
target_layer: str | Layer,
Expand Down
4 changes: 2 additions & 2 deletions src/ndev_workflows/_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,8 @@ def __repr__(self) -> str:
"""Return a string representation of the workflow."""
n_tasks = len(self._tasks)
roots = self.roots()
leafs = self.leaves()
return f'Workflow({n_tasks} tasks, roots={roots}, leafs={leafs})'
leaves = self.leaves()
return f'Workflow({n_tasks} tasks, roots={roots}, leaves={leaves})'

def copy(self) -> Workflow:
"""Create a deep copy of this workflow.
Expand Down
5 changes: 5 additions & 0 deletions src/ndev_workflows/napari.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ contributions:
- id: ndev-workflows.workflow_container
title: Workflow Container
python_name: ndev_workflows.widgets._workflow_container:WorkflowContainer
- id: ndev-workflows.workflow_inspector
title: Workflow Inspector
python_name: ndev_workflows.widgets._workflow_inspector:WorkflowInspector
widgets:
- command: ndev-workflows.workflow_container
display_name: Workflow Container
- command: ndev-workflows.workflow_inspector
display_name: Workflow Inspector
6 changes: 6 additions & 0 deletions src/ndev_workflows/widgets/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""ndev-workflows widgets for napari integration."""

from ._workflow_container import WorkflowContainer
from ._workflow_inspector import WorkflowInspector

__all__ = ['WorkflowContainer', 'WorkflowInspector']
Loading