          logger.debug("getting poup position")
          init_pos = [120, 120]
          pos = init_pos
          while True:
              if pos not in self.popup_positions:
                  self.popup_positions.append(pos)
                  break
              pos = [item + 200 for item in pos]
              init_pos, pos = self.data_popup_check_boundaries(init_pos, pos)
          logger.debug("Position: %s", pos)
          return pos
 
</s> remove             init_pos, pos = self.data_popup_check_boundaries(init_pos, pos)
 </s> add             init_pos, pos = self._data_popup_check_boundaries(init_pos, pos) </s> remove     def data_popup_get_position(self):
        """ Get the position of the next window """
 </s> add         Returns
        -------
        list
            The [x, y] co-ordinates that the pop up window should be placed at
        """ </s> remove     def data_popup_check_boundaries(self, initial_position, position):
        """ Check that the popup remains within the screen boundaries """
 </s> add     def _data_popup_check_boundaries(self, initial_position, position):
        """ Check that the popup remains within the screen boundaries.

        Parameters
        ----------
        initial_position: list
            The [x, y] position of the last displayed popup window
        position: list
            The requested [x, y] position for the new popup window

        Returns
        -------
        tuple
            The original initial_position and position, adjusted if the new window would go out of
            bounds
        """ </s> remove         return "{} - {}".format(title, self.session.modeldir)
 </s> add         return "{} - {}".format(title, model_dir)

    def _data_popup_get_position(self):
        """ Get the position of the next window to pop the summary graph to. </s> remove         xrng = [x for x in range(self.calcs.iterations)]
 </s> add         if self.calcs.start_iteration > 0:
            end_iteration = self.calcs.start_iteration + self.calcs.iterations
            xrng = list(range(self.calcs.start_iteration, end_iteration))
        else:
            xrng = list(range(self.calcs.iterations))

            if pos not in self._popup_positions:
                self._popup_positions.append(pos)
          logger.debug("getting poup position")
          init_pos = [120, 120]
          pos = init_pos
          while True:
            if pos not in self._popup_positions:
                self._popup_positions.append(pos)
            if pos not in self._popup_positions:
                self._popup_positions.append(pos)
                  break
              pos = [item + 200 for item in pos]
              init_pos, pos = self.data_popup_check_boundaries(init_pos, pos)
          logger.debug("Position: %s", pos)
          return pos
keep keep keep keep replace replace keep keep keep keep keep
 GUI - Stats optimization (#1067)

* Faster stat loading + caching

* Compress data in cache

* Optimize some calculations

* Vectorize smoothing

* stats.Calculations optimized

* Load latest training data from live iterator

* Add options to training graph 
lib/gui/display_analysis.py