Coverage for ezstitcher/core/abstract_step.py: 86%

7 statements  

« prev     ^ index     » next       coverage.py v7.3.2, created at 2025-04-30 13:20 +0000

1""" 

2Abstract base class for steps in the EZStitcher pipeline architecture. 

3 

4This module defines the AbstractStep interface that all steps must implement, 

5ensuring a consistent interface across different step implementations. 

6""" 

7 

8from abc import ABC, abstractmethod 

9from typing import List, Any, Optional, Dict 

10from .pipeline_base import StepInterface 

11 

12# ProcessingContext is defined in pipeline.py 

13# Using string literal for type annotations to avoid circular imports 

14 

15 

16class AbstractStep(StepInterface): 

17 """ 

18 Abstract base class defining the interface for all steps in EZStitcher. 

19 

20 This class defines the minimal contract that all step implementations must follow, 

21 ensuring consistent behavior across different step types. 

22 """ 

23 

24 @abstractmethod 

25 def process(self, group: List[Any], context: Optional['ProcessingContext'] = None) -> Any: 

26 """ 

27 Process a group of images. 

28 

29 This is the core method that all steps must implement. It takes a group 

30 of images and processes them according to the step's functionality. 

31 

32 Args: 

33 group: Group of images to process 

34 context: Pipeline context for sharing data between steps 

35 

36 Returns: 

37 Processed result (typically an image or list of images) 

38 """ 

39 pass