Beispiel #1
0
 def __del__(self):
     self._axes = None
     self._curves = None
     self._percentiles = None
     self._reference_idx.clear()
     self._reference_parameters.clear()
     BrushableCanvas.__del__(self)
 def __del__(self):
     self._disconnect_cb()
     self._axes = None
     self._control_points = None
     self._curves = None
     self._reference_idx.clear()
     self._reference_parameters.clear()
     self._cb_notify_timestep = None
     self._cb_notify_tooltip = None
     BrushableCanvas.__del__(self)
Beispiel #3
0
 def __del__(self):
     self._disconnect_cb()
     self._axes = None
     self._rank_series = None
     self._curves = None
     self._curves_colors.clear()
     self._reference_idx.clear()
     self._reference_parameters.clear()
     self._baseline_idx = None
     self._cb_notify_tooltip = None
     BrushableCanvas.__del__(self)
Beispiel #4
0
    def __init__(self,
                 canvas_name,
                 parent=None,
                 width=5,
                 height=5,
                 dpi=100,
                 **kwargs):
        """
        Parameters
        ----------
        canvas_name: str
            The name of this object. To be used when notifying the parent widget
            of changes.
        parent: Qt5.QWidget
            The parent widget. Default is None. The parent widget must implement
            the 'brush_series' method. This method receives this objects's
            canvas_name and a list containing the indices of all objects
            highlighted.
        width: int
            The width of this plot canvas. Default value is 5.
        height: int
            The height of this plot canvas. Default value is 5.
        dpi: int
            This canvas's resolution. Default value is 100.
        kwargs:
            Other keyword arguments.
        """
        # Initial setup
        fig = Figure(figsize=(width, height), dpi=dpi)
        self._axes = fig.add_subplot(1, 1, 1)
        FigureCanvas.__init__(self, fig)
        FigureCanvas.setSizePolicy(self, QSizePolicy.Expanding,
                                   QSizePolicy.Expanding)
        FigureCanvas.updateGeometry(self)
        self.setParent(parent)
        BrushableCanvas.__init__(self, canvas_name, parent)

        self._zphandler = ZoomPanHandler(self.axes, scale_factor=1.5)

        # Data setup
        self._curves = None
        self._reference_idx = set()
        self._baseline_idx = None
        self._rank_series = None
        self._curvenames = None
        self._plotted_series = None
        self._rank_inverted = False
        self._time_range = ()

        # Plot style setup
        self._plot_title = self.base_plot_name()
        self._reference_parameters = {}
        self._cmap_name = 'rainbow'
        self._curves_colors = {}
        self._hthresh_line = None
        self._ts_line = None
        self._group_selection = False
        self._plot_params = kwargs
        if 'picker' not in self._plot_params:
            self._plot_params['picker'] = 2
        if 'linewidth' not in self._plot_params:
            self._plot_params['linewidth'] = 1.5

        self._perctext = None
        # Callback IDs
        self._cb_mouse_move_id = None
        self._cb_mouse_button_id = None
        self._cb_scrollwheel_id = None
        self._cb_axes_leave_id = None
        self._cb_fig_leave_id = None

        # Callbacks
        self._cb_notify_tooltip = None

        self._connect_cb()
    def __init__(self,
                 canvas_name,
                 parent=None,
                 width=5,
                 height=5,
                 dpi=100,
                 **kwargs):
        """
        Parameters
        ----------
        canvas_name: str
            The name of this object. To be used when notifying the parent widget
            of changes.
        parent: Qt5.QWidget
            The parent widget. Default is None. The parent widget must implement
            the 'brush_series' method. This method receives this objects's
            canvas_name and a list containing the indices of all objects
            highlighted.
        width: int
            The width of this plot canvas. Default value is 5.
        height: int
            The height of this plot canvas. Default value is 5.
        dpi: int
            This canvas's resolution. Default value is 100.
        kwargs:
            Other keyword arguments. These arguments are used when plotting the
            line and point projections. No line or point specific options may
            be set here. Set those using the
            set_line_plot_params/set_point_plot_params methods.
        """
        # Initial setup
        fig = Figure(figsize=(width, height), dpi=dpi)
        self._axes = fig.add_subplot(1, 1, 1)
        FigureCanvas.__init__(self, fig)
        FigureCanvas.setSizePolicy(self, QSizePolicy.Expanding,
                                   QSizePolicy.Expanding)
        FigureCanvas.updateGeometry(self)
        self.setParent(parent)
        BrushableCanvas.__init__(self, canvas_name, parent)

        self._zphandler = ZoomPanHandler(self.axes, scale_factor=1.5)

        # Data setup
        self._curves = None
        self._control_points = None
        self._projected_curves = []
        self._timestep_data = [0, 0, 1]
        self._reference_idx = set()
        self._dims = 2
        self._tree = None
        self._curvenames = None
        self._hidden_curves = set()

        # Plot styles
        self._plot_lines = False
        self._plot_points = True
        self._point_artists = {}
        self._line_artists = {}
        self._plot_title = self.base_plot_name()
        self._reference_parameters = {}
        self._cmap_name = 'rainbow'
        self._plot_params = kwargs
        if 'picker' not in self._plot_params:
            self._plot_params['picker'] = 3

        self._plot_line_params = dict(linewidth=1.5)
        self._plot_point_params = dict(s=40)

        # Callback IDs
        self._cb_pick_id = None
        self._cb_mouse_move_id = None
        self._cb_scrollwheel_id = None
        self._cb_axes_leave_id = None
        self._cb_fig_leave_id = None

        # Callback functions
        self._cb_notify_timestep = None
        self._cb_notify_tooltip = None

        self._connect_cb()
Beispiel #6
0
    def __init__(self,
                 canvas_name,
                 parent=None,
                 width=5,
                 height=5,
                 dpi=100,
                 q=np.arange(0, 110, 10),
                 **kwargs):
        """
        Parameters
        ----------
        canvas_name: str
            The name of this object. To be used when notifying the parent
            widget of changes.
        parent: Qt5.QWidget
            The parent widget. Default is None. The parent widget must
            implement the 'set_brush_data' method. This method receives
            this objects's canvas_name and a list containing the indices of
            all objects highlighted.
        width: int
            The width of this plot canvas. Default value is 5.
        height: int
            The height of this plot canvas. Default value is 5.
        dpi: int
            This canvas's resolution. Default value is 100.
        q: array
            A list of percentiles to pass to np.percentile.
        kwargs: other named arguments
            Other arguments to pass to fill_between.
        """
        # Initial setup
        fig = Figure(figsize=(width, height), dpi=dpi)
        self._axes = fig.add_subplot(1, 1, 1)
        FigureCanvas.__init__(self, fig)
        FigureCanvas.setSizePolicy(self, QSizePolicy.Expanding,
                                   QSizePolicy.Expanding)
        FigureCanvas.updateGeometry(self)
        self.setParent(parent)
        BrushableCanvas.__init__(self, canvas_name, parent)

        self._zphandler = ZoomPanHandler(self.axes, scale_factor=1.5)

        # Data setup
        self._curves = None
        self._percentiles = q
        self._reference_idx = set()
        self._highlighted_ts = None
        self._curvenames = None
        self._time_range = ()
        self._hidden_ref = set()

        # Plot styles
        self._plot_title = self.base_plot_name()
        self._cmap_name = 'rainbow'
        self._fan_cmap_name = 'gray_r'
        self._curves_colors = {}
        self._reference_parameters = {}
        self._vline = None
        self._vline_props = {}
        self._plotted_lines = None
        self._time_range_poly = None
        self._time_range = ()
        self._hovered_line = None
        self._plot_params = kwargs
        if 'linewidth' not in self._plot_params:
            self._plot_params['linewidth'] = 1.5