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
23 changes: 22 additions & 1 deletion niaaml_gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,27 @@ def __init__(self):
self.errorMessage.setStandardButtons(QMessageBox.StandardButton.Ok)

def run_pipeline(self):

invalid_blocks = []

for block, info in self.pipelineCanvas.block_data.items():
label = info.get("label", "")
if hasattr(block, "get_value"):
value = block.get_value()
elif hasattr(block, "dropdown"):
value = block.dropdown.currentText()
else:
value = info.get("path") or getattr(block, "value", None)

if not value or (isinstance(value, str) and not value.strip()):
invalid_blocks.append(label)

if invalid_blocks:
msg = "Pipeline isn't set up correctly. Missing components:\n\n" + "\n".join(f"- {label}" for label in invalid_blocks)
self.errorMessage.setText(msg)
self.errorMessage.exec()
return

blocks = self.pipelineCanvas.block_data
if not blocks:
self.errorMessage.setText("Pipeline is empty!")
Expand Down Expand Up @@ -175,7 +196,7 @@ def validate_pipeline_ready(self):
value = block.dropdown.currentText()
else:
value = info.get("path") or getattr(block, "value", None)

if not value or (isinstance(value, str) and not value.strip()):
all_valid = False
break
Expand Down
2 changes: 0 additions & 2 deletions tests/test_pipeline_canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ def test_pipeline_ready_false_when_empty(canvas):
canvas.block_data.clear()
canvas.scene.clear()

print("Block data keys:", canvas.block_data.keys())

assert len(canvas.block_data) == 0
assert not canvas.is_pipeline_ready()

Loading