#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+"""A text-based simple histogram helper class."""
import math
-from numbers import Number
from typing import Dict, Generic, Iterable, List, Optional, Tuple, TypeVar
T = TypeVar("T", int, float)
class SimpleHistogram(Generic[T]):
+ """A simple histogram."""
+
# Useful in defining wide open bottom/top bucket bounds:
POSITIVE_INFINITY = math.inf
NEGATIVE_INFINITY = -math.inf
max_label_width = label_width
if start == last_bucket_start:
break
- assert max_label_width
- assert lowest_start
- assert highest_end
+ assert max_label_width is not None
+ assert lowest_start is not None
+ assert highest_end is not None
sigma_label = f'[{label_formatter}..{label_formatter}): ' % (
lowest_start,