def METHOD_NAME(depth, min_size, max_size):
    if not depth:
        return None
    bin_size = int(round(bp_per_bin / depth))
    if bin_size < min_size:
        logging.info(
            "Limiting est. bin size %d to given min. %d", bin_size, min_size
        )
        bin_size = min_size
    elif bin_size > max_size:
        logging.info(
            "Limiting est. bin size %d to given max. %d", bin_size, max_size
        )
        bin_size = max_size
    return bin_size