Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • s2dv s2dv
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 17
    • Issues 17
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Earth SciencesEarth Sciences
  • s2dvs2dv
  • Merge requests
  • !202

Add warning for 'prob_thresholds' default value in RPSS.R

  • Review changes

  • Download
  • Patches
  • Plain diff
Open abatalla requested to merge dev-add_prob_thresholds_warning into master Jun 19, 2025
  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 1

This MR stems from #127, which involved testing the RPSS() and BrierScore() functions. With @nperez, we noted that while the prob_thresholds parameter is well documented, it can substantially affect the output. As also discussed with @vagudets, making the parameter mandatory could be a good solution, but it would break backward compatibility (and also the parameter is not needed when the inputs are probabilities and the reference forecast is provided).

Therefore, to help users better understand how their inputs are handled, this MR introduces a warning that is triggered when prob_terciles is not explicit provided. The warning gives one of three context-specific messages, explaining how the default value c(1/3, 2/3) is applied depending on the user’s input:

  ## prob_thresholds
  if (is.null(cat_dim) || (!is.null(cat_dim) && is.null(ref))) {
    ...
    if (missing(prob_thresholds)) {
      if (is.null(cat_dim) && is.null(ref)) {
        .warning("Parameter 'prob_thresholds' is not provided. Default value c(1/3, 2/3) is used.\n",
                 "Since the inputs are ensemble members (i.e., 'cat_dim' is NULL) and no reference ",
                 "forecast is provided, this default will be used both to compute category ",
                 "probabilities and the reference climatology.")
      } else if (is.null(cat_dim) && !is.null(ref)) {
        .warning("Parameter 'prob_thresholds' is not provided. Default value c(1/3, 2/3) is used.\n",
                 "Since the inputs are ensemble members (i.e., 'cat_dim' is NULL), this default will ",
                 "be used to compute category probabilities.")
      } else { # if (!is.null(cat_dim) && is.null(ref))
        .warning("Parameter 'prob_thresholds' is not provided. Default value c(1/3, 2/3) is used.\n",
                 "Since no reference forecast is provided, this default will be used to compute ",
                 "the reference climatology.")
      }
    }
  }

Ariadna

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: dev-add_prob_thresholds_warning