from __future__ import annotations

import numpy as np

from ..base import BaseAcquisition


class EntropySearchLite(BaseAcquisition):
    """Simple uncertainty/entropy score for Gaussian marginal posterior.

    For a Gaussian marginal, entropy is proportional to log(std).
    """

    name = "entropy"

    def __call__(self, X, mean, std, y_observed=None, observed_mask=None, maximize: bool = True, **kwargs):
        std = np.maximum(np.asarray(std, dtype=float).reshape(-1), 1.0e-300)
        return np.log(std)
