(cls)
Initializes the plot mode based on
        the 'mode-specific parameters' above.
        Only intended to be called by
        PlotMode._register(). To use a mode without
        registering it, you can directly call
        ModeSubclass._init_mode().
Initializes the plot mode based on
        the 'mode-specific parameters' above.
        Only intended to be called by
        PlotMode._register(). To use a mode without
        registering it, you can directly call
        ModeSubclass._init_mode().
Initializes the plot mode based on the mode - specific parameters above . Only intended to be called by PlotMode . _register () . To use a mode without registering it you can directly call ModeSubclass . _init_mode () .
def _init_mode(cls):
        """
        Initializes the plot mode based on
        the 'mode-specific parameters' above.
        Only intended to be called by
        PlotMode._register(). To use a mode without
        registering it, you can directly call
        ModeSubclass._init_mode().
        """
        def symbols_list(symbol_str):
            return [Symbol(s) for s in symbol_str]

        # Convert the vars strs into
        # lists of symbols.
        cls.i_vars = symbols_list(cls.i_vars)
        cls.d_vars = symbols_list(cls.d_vars)

        # Var count is used often, calculate
        # it once here
        cls.i_var_count = len(cls.i_vars)
        cls.d_var_count = len(cls.d_vars)

        if cls.i_var_count > PlotMode._i_var_max:
            raise ValueError(var_count_error(True, False))
        if cls.d_var_count > PlotMode._d_var_max:
            raise ValueError(var_count_error(False, False))

        # Try to use first alias as primary_alias
        if len(cls.aliases) > 0:
            cls.primary_alias = cls.aliases[0]
        else:
            cls.primary_alias = cls.__name__

        di = cls.intervals
        if len(di) != cls.i_var_count:
            raise ValueError("Plot mode must provide a "
                             "default interval for each i_var.")
        for i in range(cls.i_var_count):
            # default intervals must be given [min,max,steps]
            # (no var, but they must be in the same order as i_vars)
            if len(di[i]) != 3:
                raise ValueError("length should be equal to 3")

            # Initialize an incomplete interval,
            # to later be filled with a var when
            # the mode is instantiated.
            di[i] = PlotInterval(None, *di[i])

        # To prevent people from using modes
        # without these required fields set up.
        cls._was_initialized = True
def _init_mode ( cls ) : def symbols_list ( symbol_str ) : return [ Symbol ( s ) for s in symbol_str ] # Convert the vars strs into # lists of symbols. cls . i_vars = symbols_list ( cls . i_vars ) cls . d_vars = symbols_list ( cls . d_vars ) # Var count is used often, calculate # it once here cls . i_var_count = len ( cls . i_vars ) cls . d_var_count = len ( cls . d_vars ) if cls . i_var_count > PlotMode . _i_var_max : raise ValueError ( var_count_error ( True , False ) ) if cls . d_var_count > PlotMode . _d_var_max : raise ValueError ( var_count_error ( False , False ) ) # Try to use first alias as primary_alias if len ( cls . aliases ) > 0 : cls . primary_alias = cls . aliases [ 0 ] else : cls . primary_alias = cls . __name__ di = cls . intervals if len ( di ) != cls . i_var_count : raise ValueError ( "Plot mode must provide a " "default interval for each i_var." ) for i in range ( cls . i_var_count ) : # default intervals must be given [min,max,steps] # (no var, but they must be in the same order as i_vars) if len ( di [ i ] ) != 3 : raise ValueError ( "length should be equal to 3" ) # Initialize an incomplete interval, # to later be filled with a var when # the mode is instantiated. di [ i ] = PlotInterval ( None , * di [ i ] ) # To prevent people from using modes # without these required fields set up. cls . _was_initialized = True