def check_diameters(vessel, new_ID, new_OD):
    """ Change the vessel's ID and OD and return the resulting safety factor.
    """
    if new_OD <= new_ID:
        # OD must be larger than ID by any finite amount
        # Otherwise, don't try calculating, may cause error
        return 0
    else:
        vessel.modify_parameters(ID=new_ID, OD=new_OD)
        return vessel.SF