If all the labels are the same (all negative or all positive), then there are NaNs in both the ROC and PR points. Also, both the ROC and PR areas are NaN. While this makes sense, this is not helpful or useful output. Therefore this case needs some sort of special handling. I would prefer some sort of value, so as to not impede experimental workflows, probably with a warning, but quitting with an error would also be an option.
If all the labels are the same (all negative or all positive), then there are NaNs in both the ROC and PR points. Also, both the ROC and PR areas are NaN. While this makes sense, this is not helpful or useful output. Therefore this case needs some sort of special handling. I would prefer some sort of value, so as to not impede experimental workflows, probably with a warning, but quitting with an error would also be an option.