      Notes
      -----
      Adapted from: https://stackoverflow.com/questions/42869495
      """
      def __init__(self, data, amount):
          assert data.ndim == 1
          amount = min(max(amount, 0.001), 0.999)
  
          self._data = data
          self._alpha = 1. - amount
 
</s> remove         self._data = data
 </s> add         self._data = np.nan_to_num(data) </s> remove     def _ewma_vectorized_safe(self):
 </s> add     def _ewma_vectorized_safe(self) -> None: </s> remove         logger.debug("Refreshed")
 </s> add         logger.debug("Refreshed: %s", {k: f"Total: {len(v)}, Min: {np.nanmin(v)}, "
                                          f"Max: {np.nanmax(v)}, "
                                          f"nans: {np.count_nonzero(np.isnan(v))}"
                                       for k, v in self.stats.items()}) </s> remove         mean = np.mean(data)
        limit = np.std(data)
 </s> add         mean = np.mean(np.nan_to_num(data))
        limit = np.std(np.nan_to_num(data)) </s> remove     def __init__(self, session):
 </s> add     def __init__(self, session: GlobalSession) -> None:
    def __init__(self, data: np.ndarray, amount: float) -> None:
      Notes
      -----
      Adapted from: https://stackoverflow.com/questions/42869495
      """
    def __init__(self, data: np.ndarray, amount: float) -> None:
          assert data.ndim == 1
          amount = min(max(amount, 0.001), 0.999)
  
          self._data = data
          self._alpha = 1. - amount
keep keep keep keep replace keep keep keep keep keep
 Bugfixes:
  - Stats graph - Handle NaNs in data
  - logger - de-elevate matplotlib font messages 
lib/gui/analysis/stats.py