Ejemplo n.º 1
0
    def setUp(self):
        ImportedDataTest.setUp(self)

        plugin = ChannelStatisticPlugin()
        self.op = op = plugin.get_operation()

        op.name = "MeanByDox"
        op.channel = "Y2-A"
        op.statistic_name = "Geom.Mean"
        op.by = ['Dox']
        op.subset_list.append(CategorySubset(name="Well", values=["A", "B"]))

        self.wi = wi = WorkflowItem(operation=op)
        self.workflow.workflow.append(wi)
        self.workflow.selected = wi

        self.assertTrue(wait_for(wi, 'status', lambda v: v == 'valid', 10))
Ejemplo n.º 2
0
    def testChangeParams(self):
        self.op.h = 3
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v == 'invalid', 30))
        self.assertTrue(
            self.workflow.remote_eval("self.workflow[-1].result is None"))

        self.op.do_estimate = True
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v == 'valid', 120))

        self.op.h0 = 2
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v == 'invalid', 30))
        self.assertTrue(
            self.workflow.remote_eval("self.workflow[-1].result is None"))

        self.op.do_estimate = True
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v == 'valid', 120))

        self.op.tol = 0.3
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v == 'invalid', 30))
        self.assertTrue(
            self.workflow.remote_eval("self.workflow[-1].result is None"))

        self.op.do_estimate = True
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v == 'valid', 120))

        self.op.merge_dist = 3
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v == 'invalid', 30))
        self.assertTrue(
            self.workflow.remote_eval("self.workflow[-1].result is None"))

        self.op.do_estimate = True
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v == 'valid', 120))
Ejemplo n.º 3
0
    def setUp(self):
        ImportedDataTest.setUp(self)

        self.wi = wi = self.workflow.workflow[0]
        self.wi.operation.events = 500

        plugin = RadvizPlugin()
        self.view = view = plugin.get_view()

        view.channels_list = [
            _Channel(channel="B1-A", scale="log"),
            _Channel(channel="V2-A", scale="log"),
            _Channel(channel="Y2-A", scale="log")
        ]

        wi.views.append(view)
        wi.current_view = view
        self.workflow.selected = self.wi

        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))
Ejemplo n.º 4
0
    def setUp(self):
        ImportedDataTest.setUp(self)

        plugin = BinningPlugin()
        self.op = op = plugin.get_operation()

        op.name = "Bin"
        op.channel = "V2-A"
        op.scale = "log"
        op.bin_width = 0.2

        self.wi = wi = WorkflowItem(operation=op)
        wi.default_view = op.default_view()
        wi.view_error = "Not yet plotted"
        wi.views.append(self.wi.default_view)

        self.workflow.workflow.append(wi)
        self.workflow.selected = wi

        self.assertTrue(wait_for(wi, 'status', lambda v: v == 'valid', 10))
Ejemplo n.º 5
0
    def testChangeThreshold(self):
        self.op.xlow = 0
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v != 'valid', 130))
        self.assertTrue(wait_for(self.wi, 'status', lambda v: v == 'valid',
                                 30))

        self.op.xhigh = 200
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v != 'valid', 130))
        self.assertTrue(wait_for(self.wi, 'status', lambda v: v == 'valid',
                                 30))

        self.op.ylow = 900
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v != 'valid', 130))
        self.assertTrue(wait_for(self.wi, 'status', lambda v: v == 'valid',
                                 30))

        self.op.yhigh = 11000
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v != 'valid', 130))
        self.assertTrue(wait_for(self.wi, 'status', lambda v: v == 'valid',
                                 30))
Ejemplo n.º 6
0
    def setUp(self):
        TasbeTest.setUp(self)
 
        plugin = BeadCalibrationPlugin()
        self.op = op = plugin.get_operation()
        
        self.cwd = os.path.dirname(os.path.abspath(__file__))
        op.beads_name = "Spherotech RCP-30-5A Lot AG01, AF02, AD04 and AAE01"
        op.beads_file = self.cwd + "/../../cytoflow/tests/data/tasbe/beads.fcs"
        op.units_list = [_Unit(channel = "FITC-A", unit = "MEFL"),
                         _Unit(channel = "Pacific Blue-A", unit = "MEBFP")]
        
        self.wi = wi = WorkflowItem(operation = op)
        wi.default_view = self.op.default_view()
        wi.view_error = "Not yet plotted"
        wi.views.append(self.wi.default_view)
        
        self.workflow.workflow.append(wi)
        self.workflow.selected = self.wi
          
        # run the estimate
        op.do_estimate = True
        self.assertTrue(wait_for(wi, 'status', lambda v: v == 'valid', 30))
Ejemplo n.º 7
0
    def setUp(self):
        ImportedDataTest.setUp(self)

        plugin = GaussianMixture1DPlugin()
        self.op = op = plugin.get_operation()

        op.name = "Gauss"
        op.channel = "V2-A"
        op.channel_scale = "logicle"
        op.num_components = 2

        op.subset_list.append(CategorySubset(name="Well", values=["A", "B"]))

        self.wi = wi = WorkflowItem(operation=op)
        wi.default_view = op.default_view()
        wi.view_error = "Not yet plotted"
        wi.views.append(self.wi.default_view)

        self.workflow.workflow.append(wi)
        self.workflow.selected = wi

        # run estimate
        op.do_estimate = True
        self.assertTrue(wait_for(wi, 'status', lambda v: v == 'valid', 30))
Ejemplo n.º 8
0
 def testYfacet(self):
     self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
     self.assertTrue(
         wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
     self.view.yfacet = "Well"
     self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))
Ejemplo n.º 9
0
    def testPlotArgs(self):
        self.op.by = ["Dox", "Well"]
        self.assertTrue(wait_for(self.wi, 'status', lambda v: v != 'valid',
                                 30))
        self.assertTrue(
            self.workflow.remote_eval("self.workflow[-1].result is None"))

        self.op.do_estimate = True
        self.assertTrue(wait_for(self.wi, 'status', lambda v: v == 'valid',
                                 30))

        self.view = self.wi.current_view = self.wi.default_view
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        # Common params
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.xfacet = "Dox"
        self.view.yfacet = "Well"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.title = "Title"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.xlabel = "X label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.ylabel = "Y label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.sharex = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.sharey = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.despine = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.xfacet = ""
        self.view.huefacet = "Dox"
        self.view.plot_params.huelabel = "Hue label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.legend = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        ## Scatterplot-specific params
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.min_quantile = 0.01
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.max_quantile = 0.90
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.alpha = 0.5
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.s = 5
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        for m in SCATTERPLOT_MARKERS:
            self.workflow.remote_exec(
                "self.workflow[-1].view_error = 'waiting'")
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
            self.view.plot_params.marker = m
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "", 30))
Ejemplo n.º 10
0
    def testAllFunctions(self):
        self.op.statistic_name = "Mean"
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v == 'invalid', 5))
        self.assertTrue(wait_for(self.wi, 'status', lambda v: v == 'valid',
                                 30))

        self.op.statistic_name = "Count"
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v == 'invalid', 5))
        self.assertTrue(wait_for(self.wi, 'status', lambda v: v == 'valid',
                                 30))

        self.op.statistic_name = "Std.Dev"
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v == 'invalid', 5))
        self.assertTrue(wait_for(self.wi, 'status', lambda v: v == 'valid',
                                 30))

        self.op.statistic_name = "Geom.SD"
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v == 'invalid', 5))
        self.assertTrue(wait_for(self.wi, 'status', lambda v: v == 'valid',
                                 30))

        self.op.statistic_name = "SEM"
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v == 'invalid', 5))
        self.assertTrue(wait_for(self.wi, 'status', lambda v: v == 'valid',
                                 30))

        self.op.statistic_name = "Geom.SEM"
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v == 'invalid', 5))
        self.assertTrue(wait_for(self.wi, 'status', lambda v: v == 'valid',
                                 30))

        self.op.statistic_name = "Mean 95% CI"
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v == 'invalid', 5))
        self.assertTrue(wait_for(self.wi, 'status', lambda v: v == 'valid',
                                 30))

        self.op.statistic_name = "Geom.Mean 95% CI"
        self.assertTrue(
            wait_for(self.wi, 'status', lambda v: v == 'invalid', 5))
        self.assertTrue(wait_for(self.wi, 'status', lambda v: v == 'valid',
                                 30))
Ejemplo n.º 11
0
    def testPlotArgs(self):

        # BasePlotParams
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.xfacet = "Dox"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.title = "Title"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.xlabel = "X label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.ylabel = "Y label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.xfacet = ""
        self.view.huefacet = "Dox"
        self.view.plot_params.huelabel = "Hue label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.xfacet = "Dox"
        self.view.yfacet = ""
        self.view.huefacet = ""
        self.view.plot_params.col_wrap = 2
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        for style in ['darkgrid', 'whitegrid', 'white', 'dark', 'ticks']:
            self.workflow.remote_exec(
                "self.workflow[-1].view_error = 'waiting'")
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
            self.view.plot_params.sns_style = style
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        for context in ['poster', 'talk', 'poster', 'notebook', 'paper']:
            self.workflow.remote_exec(
                "self.workflow[-1].view_error = 'waiting'")
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
            self.view.plot_params.sns_context = context
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.legend = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.sharex = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.sharey = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.despine = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        # DataPlotParams
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.min_quantile = 0.01
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.max_quantile = 0.90
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        # Data1DPlotParams
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.lim = (0, 1000)
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.orientation = "horizontal"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        # Violin

        for bw in ['silverman', 'scott']:
            self.workflow.remote_exec(
                "self.workflow[-1].view_error = 'waiting'")
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
            self.view.plot_params.bw = bw
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        for sp in ['count', 'area', 'width']:
            self.workflow.remote_exec(
                "self.workflow[-1].view_error = 'waiting'")
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
            self.view.plot_params.scale_plot = sp
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.gridsize = 200
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        for inner in ['quartile', 'box', None]:
            self.workflow.remote_exec(
                "self.workflow[-1].view_error = 'waiting'")
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
            self.view.plot_params.inner = inner
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.split = True
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))
Ejemplo n.º 12
0
 def testChangeThreshold(self):
     self.op.threshold = 0
     self.assertTrue(wait_for(self.wi, 'status', lambda v: v != 'valid', 130))
     self.assertTrue(wait_for(self.wi, 'status', lambda v: v == 'valid', 30))
Ejemplo n.º 13
0
    def testPlotParams(self):
        

        # BasePlotParams
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.xfacet = "Dox"
        self.view.yfacet = "Well"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.title = "Title"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.xlabel = "X label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.ylabel = "Y label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))
        
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.xfacet = "Dox"
        self.view.yfacet = ""
        self.view.plot_params.col_wrap = 2
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))
         
        for style in ['darkgrid', 'whitegrid', 'white', 'dark', 'ticks']:
            self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
            self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
            self.view.plot_params.sns_style = style
            self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))
            
        for context in ['poster', 'talk', 'poster', 'notebook', 'paper']:
            self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
            self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
            self.view.plot_params.sns_context = context
            self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))
        
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.legend = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.sharex = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.sharey = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.despine = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))


        # DataPlotParams
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.min_quantile = 0.01
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.max_quantile = 0.90
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))
        
        # Data2DPlotParams
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.xlim = (0, 1000)
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))
        
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.ylim = (0, 1000)
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        ## Density-specific params

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.gridsize = 25
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.smoothed = True
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))
        
        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.smoothed_sigma = 2
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))
Ejemplo n.º 14
0
 def testDensityPlot(self):
     self.wi.default_view.show_density = True
     self.wi.current_view = self.wi.default_view
     self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "",
                              120))
Ejemplo n.º 15
0
 def testChangeBinWidthText(self):
     self.op.bin_width = "0.1"
     self.assertTrue(wait_for(self.wi, 'status', lambda v: v != 'valid', 5))
     self.assertTrue(wait_for(self.wi, 'status', lambda v: v == 'valid',
                              30))
Ejemplo n.º 16
0
    def testPlotArgs(self):

        # BasePlotParams
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.xfacet = "Dox"
        self.view.yfacet = "Well"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.title = "Title"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.xlabel = "X label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.ylabel = "Y label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.xfacet = ""
        self.view.huefacet = "Dox"
        self.view.plot_params.huelabel = "Hue label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.xfacet = "Dox"
        self.view.yfacet = ""
        self.view.huefacet = ""
        self.view.plot_params.col_wrap = 2
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        for style in ['darkgrid', 'whitegrid', 'white', 'dark', 'ticks']:
            self.workflow.remote_exec(
                "self.workflow[-1].view_error = 'waiting'")
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
            self.view.plot_params.sns_style = style
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        for context in ['poster', 'talk', 'poster', 'notebook', 'paper']:
            self.workflow.remote_exec(
                "self.workflow[-1].view_error = 'waiting'")
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
            self.view.plot_params.sns_context = context
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.legend = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.sharex = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.sharey = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.despine = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        # DataPlotParams
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.min_quantile = 0.01
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.max_quantile = 0.90
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        # Data2DPlotParams
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.xlim = (0, 1000)
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.ylim = (0, 1000)
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 15))

        # Scatterplot params

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.alpha = 0.5
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.s = 5
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.marker = '+'
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        for m in SCATTERPLOT_MARKERS:
            self.workflow.remote_exec(
                "self.workflow[0].view_error = 'waiting'")
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
            self.view.plot_params.marker = m
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "", 5))
Ejemplo n.º 17
0
    def testPlotArgs(self):

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.error_statistic = ("MeanByDox", "Geom.SD")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        # BasePlotParams

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.title = "Title"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.xlabel = "X label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.ylabel = "Y label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.huelabel = "Hue label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.variable = "Well"
        self.view.xfacet = "Dox"
        self.view.huefacet = ""
        self.view.plot_params.col_wrap = 2
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        for style in ['darkgrid', 'whitegrid', 'white', 'dark', 'ticks']:
            self.workflow.remote_exec(
                "self.workflow[-1].view_error = 'waiting'")
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
            print(style)
            self.view.plot_params.sns_style = style
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        for context in ['poster', 'talk', 'poster', 'notebook', 'paper']:
            self.workflow.remote_exec(
                "self.workflow[-1].view_error = 'waiting'")
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
            self.view.plot_params.sns_context = context
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.legend = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.sharex = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.sharey = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.despine = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        # Base1DStatisticsView

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.orientation = "horizontal"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.lim = (0, 100)
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        ## BarChartView

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.errwidth = 2
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.capsize = 5
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))
Ejemplo n.º 18
0
 def testErrorBars(self):
     self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
     self.assertTrue(
         wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
     self.view.error_statistic = ("MeanByDox", "Geom.SD")
     self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))
Ejemplo n.º 19
0
    def testPlotArgs(self):

        # BasePlotParams
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.xfacet = "Dox"
        self.view.yfacet = "Well"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.title = "Title"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.xlabel = "X label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.ylabel = "Y label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.xfacet = ""
        self.view.huefacet = "Dox"
        self.view.plot_params.huelabel = "Hue label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.xfacet = "Dox"
        self.view.yfacet = ""
        self.view.huefacet = ""
        self.view.plot_params.col_wrap = 2
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        for style in ['darkgrid', 'whitegrid', 'white', 'dark', 'ticks']:
            self.workflow.remote_exec(
                "self.workflow[-1].view_error = 'waiting'")
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
            self.view.plot_params.sns_style = style
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        for context in ['poster', 'talk', 'poster', 'notebook', 'paper']:
            self.workflow.remote_exec(
                "self.workflow[-1].view_error = 'waiting'")
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
            self.view.plot_params.sns_context = context
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.legend = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.sharex = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.sharey = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.despine = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        # DataPlotParams
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.min_quantile = 0.01
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.max_quantile = 0.90
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        # Data1DPlotParams
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.lim = (0, 1000)
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.orientation = "horizontal"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        # Histogram
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.num_bins = 500
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.histtype = "step"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.histtype = "bar"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        for linestyle in ['solid', 'dashed', 'dashdot', 'dotted']:
            self.workflow.remote_exec(
                "self.workflow[-1].view_error = 'waiting'")
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
            self.view.plot_params.linestyle = linestyle
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.linewidth = "5"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.density = True
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.plot_params.alpha = 0.1
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))
Ejemplo n.º 20
0
 def testChangeParams(self):
     self.op.keep = 0.5
     self.assertTrue(wait_for(self.wi, 'status', lambda v: v != 'valid', 5))
     self.assertTrue(self.workflow.remote_eval("self.workflow[-1].result is None"))
Ejemplo n.º 21
0
    def testPlotArgs(self):

        # Common params
        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.xfacet = "Dox"
        self.view.yfacet = "Well"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.title = "Title"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.xlabel = "X label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.ylabel = "Y label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.sharex = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.sharey = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.despine = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.xfacet = ""
        self.view.huefacet = "Dox"
        self.view.plot_params.huelabel = "Hue label"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.legend = False
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        ## Scatterplot-specific params
        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.min_quantile = 0.01
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.max_quantile = 0.90
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.alpha = 0.5
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.s = 5
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.view.plot_params.marker = '+'
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 5))

        for m in SCATTERPLOT_MARKERS:
            self.workflow.remote_exec(
                "self.workflow[0].view_error = 'waiting'")
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
            self.view.plot_params.marker = m
            self.assertTrue(
                wait_for(self.wi, 'view_error', lambda v: v == "", 5))
Ejemplo n.º 22
0
    def testChangeScale(self):
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))

        self.view.scale = "log"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))
Ejemplo n.º 23
0
 def testPlot(self):
     self.wi.current_view = self.wi.default_view
     self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))
Ejemplo n.º 24
0
    def testHueFacet(self):
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))

        self.view.huefacet = "Dox"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))
Ejemplo n.º 25
0
 def testChangeChannels(self):
     self.op.channel = "B1-A"
     self.assertTrue(wait_for(self.wi, 'status', lambda v: v != 'valid', 130))
     self.assertTrue(wait_for(self.wi, 'status', lambda v: v == 'valid', 30))
Ejemplo n.º 26
0
    def testPlot(self):
        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.wi.current_view = self.wi.default_view
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 10))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.wi.default_view.current_plot = "Autofluorescence"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 10))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.wi.default_view.current_plot = "Bleedthrough"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 10))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.wi.default_view.current_plot = "Bead Calibration"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 10))

        self.op.to_channel = "FITC-A"
        self.op.do_color_translation = True

        self.assertTrue(wait_for(self.op, 'valid_model', lambda v: not v, 30))

        self.op.translation_list[
            0].file = self.cwd + "/../../cytoflow/tests/data/tasbe/rby.fcs"
        self.op.translation_list[
            1].file = self.cwd + "/../../cytoflow/tests/data/tasbe/rby.fcs"

        self.op.do_estimate = 1
        self.assertTrue(wait_for(self.op, 'valid_model', lambda v: v, 30))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 5))
        self.wi.default_view.current_plot = "Color Translation"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 10))
Ejemplo n.º 27
0
 def testChangeName(self):
     self.op.name = "Dresh"
     self.assertTrue(wait_for(self.wi, 'status', lambda v: v != 'valid', 130))
     self.assertTrue(wait_for(self.wi, 'status', lambda v: v == 'valid', 30))
Ejemplo n.º 28
0
 def testChangeSubset(self):
     self.op.subset_list[0].selected = ["A"]
     self.assertTrue(
         wait_for(self.wi, 'status', lambda v: v == 'invalid', 30))
     self.assertTrue(wait_for(self.wi, 'status', lambda v: v == 'valid',
                              30))
Ejemplo n.º 29
0
    def testSubset(self):
        self.workflow.remote_exec("self.workflow[-1].view_error = 'waiting'")
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))

        self.view.subset_list[0].selected = ["A"]
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))
Ejemplo n.º 30
0
    def testAll(self):

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.scale = "log"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.scale = "logicle"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.xfacet = "Dox"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.xfacet = ""
        self.view.yfacet = "Dox"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.yfacet = ""
        self.view.huefacet = "Dox"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.huefacet = "Dox"
        self.view.huescale = "log"
        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))

        from cytoflowgui.subset import CategorySubset
        self.workflow.remote_exec("self.workflow[0].view_error = 'waiting'")
        self.assertTrue(
            wait_for(self.wi, 'view_error', lambda v: v == "waiting", 30))
        self.view.xfacet = ""
        self.view.yfacet = ""
        self.view.subset_list.append(
            CategorySubset(name="Well", values=['A', 'B']))
        self.view.subset_list[0].selected = ['A']

        self.assertTrue(wait_for(self.wi, 'view_error', lambda v: v == "", 30))