MCPcopy Create free account
hub / github.com/ScrapeGraphAI/scrapecraft / get_phase_progress

Method get_phase_progress

backend/app/models/workflow.py:154–168  ·  view source on GitHub ↗

Get progress percentage based on current phase.

(self)

Source from the content-addressed store, hash-verified

152 break
153
154 def get_phase_progress(self) -> float:
155 """Get progress percentage based on current phase."""
156 phase_weights = {
157 WorkflowPhase.INITIAL: 0.0,
158 WorkflowPhase.URL_COLLECTION: 0.15,
159 WorkflowPhase.URL_VALIDATION: 0.25,
160 WorkflowPhase.SCHEMA_DEFINITION: 0.40,
161 WorkflowPhase.SCHEMA_VALIDATION: 0.50,
162 WorkflowPhase.CODE_GENERATION: 0.70,
163 WorkflowPhase.READY_TO_EXECUTE: 0.85,
164 WorkflowPhase.EXECUTING: 0.90,
165 WorkflowPhase.COMPLETED: 1.0,
166 WorkflowPhase.ERROR: -1.0
167 }
168 return phase_weights.get(self.phase, 0.0)
169
170 def can_transition_to(self, target_phase: WorkflowPhase) -> bool:
171 """Check if transition to target phase is allowed."""

Callers 3

get_workflow_summaryMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected