def reldiag_init(X_min, n_bins=10, min_count=10):
    """
    Initialize a reliability diagram object.

    Parameters
    ----------
    X_min: float
      Precipitation intensity threshold for yes/no prediction.
    n_bins: int
        Number of bins to use in the reliability diagram.
    min_count: int
      Minimum number of samples required for each bin. A zero value is assigned
      if the number of samples in a bin is smaller than bin_count.

    Returns
    -------
    out: dict
      The reliability diagram object.

    References
    ----------
    :cite:`BS2007`
    """
    reldiag = {}

    reldiag["X_min"] = X_min
    reldiag["bin_edges"] = np.linspace(-1e-6, 1 + 1e-6, int(n_bins + 1))
    reldiag["n_bins"] = n_bins
    reldiag["X_sum"] = np.zeros(n_bins)
    reldiag["Y_sum"] = np.zeros(n_bins, dtype=int)
    reldiag["num_idx"] = np.zeros(n_bins, dtype=int)
    reldiag["sample_size"] = np.zeros(n_bins, dtype=int)
    reldiag["min_count"] = min_count

    return reldiag
Initialize a reliability diagram object.

Parameters
----------
X_min: float
Precipitation intensity threshold for yes/no prediction.
n_bins: int
Number of bins to use in the reliability diagram.
min_count: int
Minimum number of samples required for each bin. A zero value is assigned
if the number of samples in a bin is smaller than bin_count.

Returns
-------
out: dict
The reliability diagram object.

References
----------
:cite:`BS2007`
pysteps/verification/probscores.py