"""
Sentinel technical indicators.
"""


class Indicators:
    """
    Compute explainable equipment indicators.
    """

    @staticmethod
    def compressor_stress(
        compressor_temperature: float,
        compressor_current: float,
    ) -> float:
        """
        Compute a provisional compressor stress score from 0 to 100.

        A score of 0 represents nominal operation.
        A score of 100 represents very high stress.
        """
        temperature_stress = 0.0

        if compressor_temperature > 55.0:
            temperature_stress = min(
                (compressor_temperature - 55.0) * 4.0,
                100.0,
            )

        current_stress = 0.0

        if compressor_current > 2.2:
            current_stress = min(
                (compressor_current - 2.2) * 50.0,
                100.0,
            )

        return round(
            temperature_stress * 0.7
            + current_stress * 0.3,
            2,
        )