import numpy as np

from typing import List
from numpy.typing import ArrayLike

from spatz.sensors import Sensor
from spatz.dataset import Dataset, List
from spatz.logger import Logger
from spatz.transforms import Transform


class CompoundSensor(Sensor):
    def __init__(self, dataset: Dataset, logger: Logger, sensors: List[Sensor], transforms: List[Transform] = []):
        super().__init__(dataset, logger, transforms)

        self.__sensors = sensors

    def _get_data(self) -> ArrayLike:
        x = np.stack([sensor() for sensor in self.__sensors])
        x = self._sensor_specific_effects(x)

        return x