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

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

    # assembly_data for each component assertions
    for i in range(len(Assembly_Data)):
        
        Parent_of_component = Assembly_Data[i]
        
        #BOM entry length assertion
        assert len(Parent_of_component) == 1, 'assembly data for component ' + str(i+1) + ' entry is improperly formated.'
        assert type(Parent_of_component[0]) == int, 'assembly data for component ' + str(i+1) + ' requires integer assembly data input' 
        assert 0 <= Parent_of_component[0] <= len(BOM), 'assembly data for component ' + str(i+1) + ' assembly data input in not in range of the BOM 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_assembly_data(product_dict):
    Assembly_Data = product_dict['Assembly_Data']
    assert Assembly_Data is not None, 'Input file requires Assembly data input(s)'  
    BOM = product_dict.get('BOM')
    assert len(Assembly_Data) == len(BOM)
    for i in range(len(Assembly_Data)):
        Parent_of_component = Assembly_Data[i]
        assert len(Parent_of_component) == 1, 'assembly data for component ' + str(i+1) + ' entry is improperly formated.'
        assert type(Parent_of_component[0]) == int, 'assembly data for component ' + str(i+1) + ' requires integer assembly data input' 
        assert 0 <= Parent_of_component[0] <= len(BOM), 'assembly data for component ' + str(i+1) + ' assembly data input in not in range of the BOM inputs'
def check_assembly_data ( product_dict ) : Assembly_Data = product_dict [ 'Assembly_Data' ] assert Assembly_Data is not None , 'Input file requires Assembly data input(s)' BOM = product_dict . get ( 'BOM' ) assert len ( Assembly_Data ) == len ( BOM ) for i in range ( len ( Assembly_Data ) ) : Parent_of_component = Assembly_Data [ i ] assert len ( Parent_of_component ) == 1 , 'assembly data for component ' + str ( i + 1 ) + ' entry is improperly formated.' assert type ( Parent_of_component [ 0 ] ) == int , 'assembly data for component ' + str ( i + 1 ) + ' requires integer assembly data input' assert 0 <= Parent_of_component [ 0 ] <= len ( BOM ) , 'assembly data for component ' + str ( i + 1 ) + ' assembly data input in not in range of the BOM 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
    -------
    
    """ #assembly_data assertion #assembly_data vertical dimension assertion # assembly_data for each component assertions #BOM entry length assertion
product_dict