Passed
Pull Request — master (#1)
by Konstantinos
01:08
created

artificial_artwork.image.image_processor   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 10
dl 0
loc 12
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A ImageProcessor.process() 0 6 2
1
from typing import List, Callable
2
from numpy.typing import NDArray
3
4
5
class ImageProcessor:
6
    def process(self, image: NDArray, pipeline: List[Callable[[NDArray], NDArray]]) -> NDArray:
7
        if len(pipeline) > 0:
8
            processor = pipeline[0]
9
            pipeline = pipeline[1:]
10
            return self.process(processor(image), pipeline)
11
        return image
12