Coverage for bioimageio/core/_op_base.py: 100%

19 statements  

« prev     ^ index     » next       coverage.py v7.6.7, created at 2024-11-19 09:02 +0000

1from abc import ABC, abstractmethod 

2from dataclasses import dataclass 

3from typing import Collection, Union 

4 

5from .sample import Sample, SampleBlock, SampleBlockWithOrigin 

6from .stat_measures import Measure 

7 

8 

9@dataclass 

10class Operator(ABC): 

11 @abstractmethod 

12 def __call__(self, sample: Union[Sample, SampleBlockWithOrigin]) -> None: ... 

13 

14 @property 

15 @abstractmethod 

16 def required_measures(self) -> Collection[Measure]: ... 

17 

18 

19@dataclass 

20class BlockedOperator(Operator, ABC): 

21 @abstractmethod 

22 def __call__( 

23 self, sample: Union[Sample, SampleBlock, SampleBlockWithOrigin] 

24 ) -> None: ... 

25 

26 @property 

27 @abstractmethod 

28 def required_measures(self) -> Collection[Measure]: ...