@staticmethod
def sanitizePartialBeams(beamsList):
    """
        It is possible at a late stage to have beams that only consist of partials
        or beams with a 'start' followed by 'partial/left' or possibly 'stop' followed
        by 'partial/right'; beams entirely consisting of partials are removed
        and the direction of irrational partials is fixed.
        """
    for i in range(len(beamsList)):
        if beamsList[i] is None:
            continue
        allTypes = beamsList[i].getTypes()
        if ('start' not in allTypes and 'stop' not in allTypes and 
            'continue' not in allTypes):
            beamsList[i] = None
            continue
        hasStart = False
        hasStop = False
        for b in beamsList[i].beamsList:
            if b.type == 'start':
                hasStart = True
                continue
            if b.type == 'stop':
                hasStop = True
                continue
            if hasStart and b.type == 'partial' and b.direction == 'left':
                b.direction = 'right'
            elif hasStop and b.type == 'partial' and b.direction == 'right':
                b.direction = 'left'
    return beamsList
