PyDamp/PyDampCheck.py
def check_function_data(product_dict):
    
    
    """ This function checks for errors in the BOM input
    
    Parameters - YAML for product information .dict
    ----------

    Returns - checked product_dict
    -------
    
    """   
    
    #function_data assertion
    Function_Data = product_dict['Function_Data']
    assert Function_Data is not None, 'Input file requires Function data input(s)'  
    
    #function_data vertical dimension assertion
    BOM = product_dict.get('BOM')
    assert len(Function_Data) == len(BOM)
    

    # assembly_data for each component assertions
    for i in range(len(Function_Data)):
        for k in range(len(Function_Data[i])):
        
            Function_of_component = Function_Data[i][k]
            
            #BOM entry length assertion
            assert type(Function_of_component) == int, 'Function data for component ' + str(i+1) + ' entry is improperly formated.'
            assert 1 <= Function_of_component <= 53, 'component ' + str(i+1) + ' assembly data input in not in range of the Function inputs'
 This function checks for errors in the BOM input
    
    Parameters - YAML for product information .dict
    ----------

    Returns - checked product_dict
    -------
    
    
This function checks for errors in the BOM input
Parameters - YAML for product information .dict


This function checks for errors in the BOM input Parameters - YAML for product information . dict
def check_function_data(product_dict):
    Function_Data = product_dict['Function_Data']
    assert Function_Data is not None, 'Input file requires Function data input(s)'  
    BOM = product_dict.get('BOM')
    assert len(Function_Data) == len(BOM)
    for i in range(len(Function_Data)):
        for k in range(len(Function_Data[i])):
            Function_of_component = Function_Data[i][k]
            assert type(Function_of_component) == int, 'Function data for component ' + str(i+1) + ' entry is improperly formated.'
            assert 1 <= Function_of_component <= 53, 'component ' + str(i+1) + ' assembly data input in not in range of the Function inputs'
def check_function_data ( product_dict ) : Function_Data = product_dict [ 'Function_Data' ] assert Function_Data is not None , 'Input file requires Function data input(s)' BOM = product_dict . get ( 'BOM' ) assert len ( Function_Data ) == len ( BOM ) for i in range ( len ( Function_Data ) ) : for k in range ( len ( Function_Data [ i ] ) ) : Function_of_component = Function_Data [ i ] [ k ] assert type ( Function_of_component ) == int , 'Function data for component ' + str ( i + 1 ) + ' entry is improperly formated.' assert 1 <= Function_of_component <= 53 , 'component ' + str ( i + 1 ) + ' assembly data input in not in range of the Function inputs'
This function checks for errors in the BOM input
Parameters - YAML for product information .dict
This function checks for errors in the BOM input Parameters - YAML for product information . dict
""" This function checks for errors in the BOM input
    
    Parameters - YAML for product information .dict
    ----------

    Returns - checked product_dict
    -------
    
    """ #function_data assertion #function_data vertical dimension assertion # assembly_data for each component assertions #BOM entry length assertion
product_dict