A ValueError should also be raised if the weights sum to zero.