From 11eeb8574b7b4620ac6fd440cb251f8aa2458f5b Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Thu, 8 Jul 2021 22:25:12 -0700 Subject: Reduce import scopes, remove cycles. --- histogram.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'histogram.py') diff --git a/histogram.py b/histogram.py index ca67839..b98e848 100644 --- a/histogram.py +++ b/histogram.py @@ -4,10 +4,6 @@ import math from numbers import Number from typing import Generic, Iterable, List, Optional, Tuple, TypeVar -from math_utils import RunningMedian -from text_utils import bar_graph - - T = TypeVar("T", bound=Number) @@ -18,6 +14,7 @@ class SimpleHistogram(Generic[T]): NEGATIVE_INFINITY = -math.inf def __init__(self, buckets: List[Tuple[T, T]]): + from math_utils import RunningMedian self.buckets = {} for start_end in buckets: if self._get_bucket(start_end[0]) is not None: @@ -70,6 +67,7 @@ class SimpleHistogram(Generic[T]): return all_true def __repr__(self) -> str: + from text_utils import bar_graph max_population: Optional[int] = None for bucket in self.buckets: pop = self.buckets[bucket] -- cgit v1.3