From e74bdc1f7848a575683999aeac895d392a52221a Mon Sep 17 00:00:00 2001 From: vagudets Date: Mon, 27 Jan 2025 14:46:04 +0100 Subject: [PATCH 1/3] Add fbbs10 and fbss90 as metrics to Skill --- modules/Skill/Skill.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Skill/Skill.R b/modules/Skill/Skill.R index 7c829c25..b59b99a0 100644 --- a/modules/Skill/Skill.R +++ b/modules/Skill/Skill.R @@ -68,7 +68,7 @@ Skill <- function(recipe, data, agg = 'global') { skill_metrics <- list() for (metric in strsplit(metrics, ", | |,")[[1]]) { # Whether the fair version of the metric is to be computed - if (metric %in% c('frps', 'frpss', 'bss10', 'bss90', + if (metric %in% c('frps', 'frpss', 'fbss10', 'fbss90', 'fcrps', 'fcrpss')) { Fair <- T } else { -- GitLab From a8e1220afbfce6f106a6b8ca43d17e283887a1a0 Mon Sep 17 00:00:00 2001 From: vagudets Date: Mon, 27 Jan 2025 16:12:50 +0100 Subject: [PATCH 2/3] Update unit test --- tests/testthat/test-decadal_monthly_3.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-decadal_monthly_3.R b/tests/testthat/test-decadal_monthly_3.R index 92950f73..6405c191 100644 --- a/tests/testthat/test-decadal_monthly_3.R +++ b/tests/testthat/test-decadal_monthly_3.R @@ -150,7 +150,7 @@ TRUE ) expect_equal( as.vector(skill_metrics$bss10[, , 1, 2]), -c(-0.1904762, -0.1904762, -0.1904762), +c(-0.3227513, -0.3227513, -0.3227513), tolerance = 0.0001 ) expect_equal( -- GitLab From 9567f813615a1ec8cd72cd872e8f6c5e20bc1788 Mon Sep 17 00:00:00 2001 From: vagudets Date: Tue, 28 Jan 2025 09:21:26 +0100 Subject: [PATCH 3/3] Add fbss10 and fbss90 to plot_metrics() --- modules/Visualization/R/plot_metrics.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Visualization/R/plot_metrics.R b/modules/Visualization/R/plot_metrics.R index 9850b2c7..5b52c062 100644 --- a/modules/Visualization/R/plot_metrics.R +++ b/modules/Visualization/R/plot_metrics.R @@ -77,7 +77,7 @@ plot_metrics <- function(recipe, data_cube, metrics, # Group different metrics by type skill_scores <- c("rpss", "bss90", "bss10", "frpss", "crpss", "mean_bias_ss", "enscorr", "rpss_specs", "bss90_specs", "bss10_specs", - "enscorr_specs", "rmsss", "msss") + "enscorr_specs", "rmsss", "msss", "fbss10", "fbss90") scores <- c("rps", "frps", "crps", "frps_specs", "mse") statistics <- c("cov", "std_hcst", "std_obs", "var_hcst", "var_obs", "n_eff") @@ -93,8 +93,8 @@ plot_metrics <- function(recipe, data_cube, metrics, units <- NULL # Define plot characteristics and metric name to display in plot if (name %in% c("rpss", "bss90", "bss10", "frpss", "crpss", - "rpss_specs", "bss90:_specs", "bss10_specs", - "rmsss", "msss")) { + "rpss_specs", "bss90_specs", "bss10_specs", + "rmsss", "msss", "fbss90", "fbss10")) { display_name <- toupper(strsplit(name, "_")[[1]][1]) metric <- var_metric[[name]] brks <- seq(-1, 1, by = 0.2) -- GitLab