lama/registration_pipeline/validate_config.py
def check_options(self):
        """
        Check the options in the lama section of the config. Perform apppropriate validation, or set default
        add the options to self.options

        """
        for option, validation in self.input_options.items():

            # # Run a function to check
            # if callable(validation):
            #     validation()  # Should have it's own merror message and exit

            checker = validation[0]
            default = validation[1]

            if default == 'required':
                if option not in self.config:
                    raise LamaConfigError(f'{option} is a required option')
            value = self.config.get(option, default)

            if checker == 'bool':
                if type(value) != bool:
                    raise (f'{option} should be a bool not a {type(value)}')

            elif checker == 'float':
                if not isinstance(value, float):
                    raise LamaConfigError(f'"{option}" should be a number (float. eg 4.6)')

            elif checker == 'int':
                isint = False
                if isinstance(value, int):
                    isint = True
                elif isinstance(value, float):
                    if value / 1 == 0:  # If it's an int in float form, that OK
                        isint = True
                if not isint:
                    raise LamaConfigError(f'"{option}" should be type {str(checker)}')

            elif checker == 'func':
                validation[1]()
                continue # Option set in function


            # Check for a list of options
            elif isinstance(checker, list):
                if value not in checker:
                    raise LamaConfigError(f'{option} should be one of {checker}')

            self.options[option] = value

        Check the options in the lama section of the config. Perform apppropriate validation, or set default
        add the options to self.options

        
Check the options in the lama section of the config. Perform apppropriate validation, or set default
add the options to self.options
Check the options in the lama section of the config . Perform apppropriate validation or set default add the options to self . options
def check_options(self):
        for option, validation in self.input_options.items():
            checker = validation[0]
            default = validation[1]
            if default == 'required':
                if option not in self.config:
                    raise LamaConfigError(f'{option} is a required option')
            value = self.config.get(option, default)
            if checker == 'bool':
                if type(value) != bool:
                    raise (f'{option} should be a bool not a {type(value)}')
            elif checker == 'float':
                if not isinstance(value, float):
                    raise LamaConfigError(f'"{option}" should be a number (float. eg 4.6)')
            elif checker == 'int':
                isint = False
                if isinstance(value, int):
                    isint = True
                elif isinstance(value, float):
                    if value / 1 == 0:  
                        isint = True
                if not isint:
                    raise LamaConfigError(f'"{option}" should be type {str(checker)}')
            elif checker == 'func':
                validation[1]()
                continue 
            elif isinstance(checker, list):
                if value not in checker:
                    raise LamaConfigError(f'{option} should be one of {checker}')
            self.options[option] = value
def check_options ( self ) : for option , validation in self . input_options . items ( ) : checker = validation [ 0 ] default = validation [ 1 ] if default == 'required' : if option not in self . config : raise LamaConfigError ( f'{option} is a required option' ) value = self . config . get ( option , default ) if checker == 'bool' : if type ( value ) != bool : raise ( f'{option} should be a bool not a {type(value)}' ) elif checker == 'float' : if not isinstance ( value , float ) : raise LamaConfigError ( f'"{option}" should be a number (float. eg 4.6)' ) elif checker == 'int' : isint = False if isinstance ( value , int ) : isint = True elif isinstance ( value , float ) : if value / 1 == 0 : isint = True if not isint : raise LamaConfigError ( f'"{option}" should be type {str(checker)}' ) elif checker == 'func' : validation [ 1 ] ( ) continue elif isinstance ( checker , list ) : if value not in checker : raise LamaConfigError ( f'{option} should be one of {checker}' ) self . options [ option ] = value
Check the options in the lama section of the config.
Check the options in the lama section of the config .
"""
        Check the options in the lama section of the config. Perform apppropriate validation, or set default
        add the options to self.options

        """ # # Run a function to check # if callable(validation): #     validation()  # Should have it's own merror message and exit # If it's an int in float form, that OK # Option set in function # Check for a list of options
self