This check is fine, but `assert rval.ndim == 1` would be shorter :)