Skip to content

Commit

Permalink
Merge pull request #287 from weecology/evaluationwork
Browse files Browse the repository at this point in the history
patching backwards compat issues with the interp updates
  • Loading branch information
juniperlsimonis authored May 27, 2022
2 parents e3e07bc + bf4da66 commit f3cca32
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: portalcasting
Title: Functions Used in Predicting Portal Rodent Dynamics
Version: 0.41.0
Version: 0.42.0
Authors@R: c(
person(c("Juniper", "L."), "Simonis",
email = "[email protected]", role = c("aut", "cre"),
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

Version numbers follow [Semantic Versioning](https://semver.org/).

# [portalcasting 0.42.0](https://github.com/weecology/portalcasting/releases/tag/v0.42.0)
*2022-05-27*


### Data interpolation moved from "dataset" to "within model"
* Patching, not all hit with previous release

# [portalcasting 0.41.0](https://github.com/weecology/portalcasting/releases/tag/v0.41.0)
*2022-05-26*

Expand Down
18 changes: 13 additions & 5 deletions R/figures.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ plot_casts_cov_RMSE <- function (main = ".",
colnames(cast_tab)[colnames(cast_tab) %in% c("data_set", "dataset")] <- "dataset"
# patch

# patch
cast_tab$dataset <- gsub("_interp", "", cast_tab$dataset)
# patch

cast_ids <- ifnull(cast_ids, unique(cast_tab$cast_id))
models <- ifnull(models, unique(cast_tab$model))
dataset <- ifnull(dataset, unique(cast_tab$dataset)[1])
Expand Down Expand Up @@ -339,6 +343,10 @@ plot_casts_err_lead <- function (main = ".",
colnames(cast_tab)[colnames(cast_tab) %in% c("data_set", "dataset")] <- "dataset"
# patch

# patch
cast_tab$dataset <- gsub("_interp", "", cast_tab$dataset)
# patch

cast_ids <- ifnull(cast_ids, unique(cast_tab$cast_id))
models <- ifnull(models, unique(cast_tab$model))
dataset <- ifnull(dataset, unique(cast_tab$dataset)[1])
Expand Down Expand Up @@ -753,7 +761,7 @@ plot_cast_point <- function (main = ".",

obs <- read_rodents_table(main = main,
settings = settings,
dataset = casts_meta$dataset)
dataset = gsub("_interp", "", casts_meta$dataset))
colnames(obs) <- gsub("\\.", "", colnames(obs))
sp_col <- is_sp_col(obs, nadot = TRUE, total = TRUE)
species <- ifnull(species, colnames(obs)[sp_col])
Expand All @@ -770,7 +778,7 @@ plot_cast_point <- function (main = ".",

}

dataset <- casts_meta$dataset
dataset <- gsub("_interp", "", casts_meta$dataset)

if (!is.null(model) && tolower(model) == "ensemble") {

Expand Down Expand Up @@ -937,7 +945,7 @@ plot_cast_ts <- function (main = ".",
dataset = NULL,
model = NULL,
end_moon = NULL,
species = "total",
species = NULL,
start_moon = 217,
quiet = FALSE) {

Expand Down Expand Up @@ -973,7 +981,7 @@ plot_cast_ts <- function (main = ".",

obs <- read_rodents_table(main = main,
settings = settings,
dataset = casts_meta$dataset)
dataset = gsub("_interp", "", casts_meta$dataset))
colnames(obs) <- gsub("\\.", "", colnames(obs))

sp_col <- is_sp_col(obs, nadot = TRUE, total = TRUE)
Expand All @@ -986,7 +994,7 @@ plot_cast_ts <- function (main = ".",
}

obs <- obs[ , c("newmoonnumber", species)]
dataset <- casts_meta$dataset
dataset <- gsub("_interp", "", casts_meta$dataset)

if (!is.null(model) && tolower(model) == "ensemble") {

Expand Down
8 changes: 4 additions & 4 deletions R/process_casts.R
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ add_obs_to_cast_tab <- function (main = ".",
# patch

cast_tab$obs <- NA
cast_dataset <- cast_tab$dataset
cast_dataset <- gsub("_interp", "", cast_tab$dataset)
ucast_dataset <- unique(cast_dataset)
ncast_datasets <- length(ucast_dataset)

Expand Down Expand Up @@ -456,10 +456,10 @@ select_casts <- function (main = ".",
models <- ifnull(models, umodels)
match_model <- casts_metadata$model %in% models

udatasets <- unique(casts_metadata$dataset[casts_metadata$QAQC])
udatasets <- gsub("_interp", "", unique(casts_metadata$dataset[casts_metadata$QAQC]))
datasets <- ifnull(datasets, udatasets)

match_dataset <- casts_metadata$dataset %in% datasets
match_dataset <- gsub("_interp", "", casts_metadata$dataset) %in% datasets

QAQC <- casts_metadata$QAQC

Expand Down Expand Up @@ -545,7 +545,7 @@ save_cast_output <- function (cast = NULL,
end_moon = cast$metadata$time$end_moon,
lead_time = cast$metadata$time$lead_time,
model = cast$metadata$models,
dataset = cast$metadata$datasets,
dataset = gsub("_interp", "", cast$metadata$datasets),
portalcasting_version = pc_version,
QAQC = TRUE,
notes = NA)
Expand Down
2 changes: 1 addition & 1 deletion man/plot_cast_ts.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f3cca32

Please sign in to comment.