def show_high_levels_pars(self, mpars):
        """
        shows in the high level mean display area in the bottom left of the
        GUI the data in mpars.
        """
        FONT_WEIGHT = self.GUI_RESOLUTION+(self.GUI_RESOLUTION-1)*5
        font2 = wx.Font(12+min(1, FONT_WEIGHT), wx.SWISS,
                        wx.NORMAL, wx.NORMAL, False, self.font_type)

        if self.mean_type_box.GetValue() != "None" and self.mean_fit_box.GetValue() != "None" and mpars:

            if isinstance(mpars, list):
                i = self.switch_stats_button.GetValue()
                if i >= len(mpars):
                    print(("Cannot display statistics as mpars does not have index %d. Was given mpars %s, aborting." % (
                        i, str(mpars))))
                    return
                self.show_high_levels_pars(mpars[i])
            elif mpars["calculation_type"].startswith('Fisher'):
                if "alpha95" in list(mpars.keys()):
                    for val in ['mean_type:calculation_type', 'dec:dec', 'inc:inc', 'alpha95:alpha95', 'K:K', 'R:R', 'n_lines:n_lines', 'n_planes:n_planes']:
                        val, ind = val.split(":")
                        COMMAND = """self.%s_window.SetValue(str(mpars['%s']))""" % (
                            val, ind)
                        exec(COMMAND)

                if self.ie_open:
                    ie = self.ie
                    if "alpha95" in list(mpars.keys()):
                        for val in ['mean_type:calculation_type', 'dec:dec', 'inc:inc', 'alpha95:alpha95', 'K:K', 'R:R', 'n_lines:n_lines', 'n_planes:n_planes']:
                            val, ind = val.split(":")
                            COMMAND = """ie.%s_window.SetValue(str(mpars['%s']))""" % (
                                val, ind)
                            exec(COMMAND)

            elif mpars["calculation_type"].startswith('Fisher by polarity'):
                i = self.switch_stats_button.GetValue()
                keys = list(mpars.keys())
                keys.remove('calculation_type')
                if 'color' in keys:
                    keys.remove('color')
                keys.sort()
                name = keys[i % len(keys)]
                mpars = mpars[name]
                if type(mpars) != dict:
                    print(
                        ("error in showing high level mean, reseaved %s" % str(mpars)))
                    return
                if mpars["calculation_type"] == 'Fisher' and "alpha95" in list(mpars.keys()):
                    for val in ['mean_type:calculation_type', 'dec:dec', 'inc:inc', 'alpha95:alpha95', 'K:k', 'R:r', 'n_lines:n', 'n_planes:n_planes']:
                        val, ind = val.split(":")
                        if val == 'mean_type':
                            COMMAND = """self.%s_window.SetValue('%s')""" % (
                                val, mpars[ind] + ":" + name)
                        else:
                            COMMAND = """self.%s_window.SetValue(str(mpars['%s']))""" % (
                                val, ind)
                        exec(COMMAND)

                if self.ie_open:
                    ie = self.ie
                    if mpars["calculation_type"] == 'Fisher' and "alpha95" in list(mpars.keys()):
                        for val in ['mean_type:calculation_type', 'dec:dec', 'inc:inc', 'alpha95:alpha95', 'K:k', 'R:r', 'n_lines:n', 'n_planes:n_planes']:
                            val, ind = val.split(":")
                            if val == 'mean_type':
                                COMMAND = """ie.%s_window.SetValue('%s')""" % (
                                    val, mpars[ind] + ":" + name)
                            else:
                                COMMAND = """ie.%s_window.SetValue(str(mpars['%s']))""" % (
                                    val, ind)
                            exec(COMMAND)

        self.set_mean_stats_color()
def show_high_levels_pars ( self , mpars ) : FONT_WEIGHT = self . GUI_RESOLUTION + ( self . GUI_RESOLUTION - 1 ) * 5 font2 = wx . Font ( 12 + min ( 1 , FONT_WEIGHT ) , wx . SWISS , wx . NORMAL , wx . NORMAL , False , self . font_type ) if self . mean_type_box . GetValue ( ) != "None" and self . mean_fit_box . GetValue ( ) != "None" and mpars : if isinstance ( mpars , list ) : i = self . switch_stats_button . GetValue ( ) if i >= len ( mpars ) : print ( ( "Cannot display statistics as mpars does not have index %d. Was given mpars %s, aborting." % ( i , str ( mpars ) ) ) ) return self . show_high_levels_pars ( mpars [ i ] ) elif mpars [ "calculation_type" ] . startswith ( 'Fisher' ) : if "alpha95" in list ( mpars . keys ( ) ) : for val in [ 'mean_type:calculation_type' , 'dec:dec' , 'inc:inc' , 'alpha95:alpha95' , 'K:K' , 'R:R' , 'n_lines:n_lines' , 'n_planes:n_planes' ] : val , ind = val . split ( ":" ) COMMAND = """self.%s_window.SetValue(str(mpars['%s']))""" % ( val , ind ) exec ( COMMAND ) if self . ie_open : ie = self . ie if "alpha95" in list ( mpars . keys ( ) ) : for val in [ 'mean_type:calculation_type' , 'dec:dec' , 'inc:inc' , 'alpha95:alpha95' , 'K:K' , 'R:R' , 'n_lines:n_lines' , 'n_planes:n_planes' ] : val , ind = val . split ( ":" ) COMMAND = """ie.%s_window.SetValue(str(mpars['%s']))""" % ( val , ind ) exec ( COMMAND ) elif mpars [ "calculation_type" ] . startswith ( 'Fisher by polarity' ) : i = self . switch_stats_button . GetValue ( ) keys = list ( mpars . keys ( ) ) keys . remove ( 'calculation_type' ) if 'color' in keys : keys . remove ( 'color' ) keys . sort ( ) name = keys [ i % len ( keys ) ] mpars = mpars [ name ] if type ( mpars ) != dict : print ( ( "error in showing high level mean, reseaved %s" % str ( mpars ) ) ) return if mpars [ "calculation_type" ] == 'Fisher' and "alpha95" in list ( mpars . keys ( ) ) : for val in [ 'mean_type:calculation_type' , 'dec:dec' , 'inc:inc' , 'alpha95:alpha95' , 'K:k' , 'R:r' , 'n_lines:n' , 'n_planes:n_planes' ] : val , ind = val . split ( ":" ) if val == 'mean_type' : COMMAND = """self.%s_window.SetValue('%s')""" % ( val , mpars [ ind ] + ":" + name ) else : COMMAND = """self.%s_window.SetValue(str(mpars['%s']))""" % ( val , ind ) exec ( COMMAND ) if self . ie_open : ie = self . ie if mpars [ "calculation_type" ] == 'Fisher' and "alpha95" in list ( mpars . keys ( ) ) : for val in [ 'mean_type:calculation_type' , 'dec:dec' , 'inc:inc' , 'alpha95:alpha95' , 'K:k' , 'R:r' , 'n_lines:n' , 'n_planes:n_planes' ] : val , ind = val . split ( ":" ) if val == 'mean_type' : COMMAND = """ie.%s_window.SetValue('%s')""" % ( val , mpars [ ind ] + ":" + name ) else : COMMAND = """ie.%s_window.SetValue(str(mpars['%s']))""" % ( val , ind ) exec ( COMMAND ) self . set_mean_stats_color ( )
shows in the high level mean display area in the bottom left of the
        GUI the data in mpars.