Skip to content

Commit

Permalink
Merge pull request #101 from dklein-pik/master
Browse files Browse the repository at this point in the history
Reorder lines in mattermost bot message.
  • Loading branch information
dklein-pik authored May 17, 2024
2 parents 505aff7 + 5999f9d commit b591590
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '4190249'
ValidationKey: '4210320'
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
- 'Warning: namespace ''.*'' is not available and has been replaced'
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cff-version: 1.2.0
message: If you use this software, please cite it using the metadata from this file.
type: software
title: 'modelstats: Run Analysis Tools'
version: 0.21.1
date-released: '2024-05-16'
version: 0.21.2
date-released: '2024-05-17'
abstract: A collection of tools to analyze model runs.
authors:
- family-names: Giannousakis
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: modelstats
Type: Package
Title: Run Analysis Tools
Version: 0.21.1
Date: 2024-05-16
Version: 0.21.2
Date: 2024-05-17
Authors@R: c(
person("Anastasis", "Giannousakis", email = "giannou@pik-potsdam.de", role = c("aut","cre")),
person("Oliver", "Richters", role = "aut")
Expand Down
20 changes: 9 additions & 11 deletions R/modeltests.R
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ evaluateRuns <- function(model, mydir, gitPath, compScen, email, mattermostToken
setwd(i)
message("Changed to ", normalizePath("."))
# Use the fulldata.gdx of a successful SSP2EU-NPi-AMT to update the gdx on the RSE server that is used for testing convGDX2MIF
if (grepl("SSP2EU-NPi-AMT", rownames(grsi))) {
if (grepl("SSP2EU-PkBudg650-AMT", rownames(grsi))) {
gdxOnRseServer <- "rse@rse.pik-potsdam.de:/webservice/data/example/remind2_test-convGDX2MIF_SSP2EU-PkBudg650-AMT.gdx"
message(paste("Updating the gdx on the RSE server", gdxOnRseServer, "with the fulldata.gdx of", rownames(grsi)))
system(paste("rsync -e ssh -av fulldata.gdx", gdxOnRseServer))
Expand Down Expand Up @@ -413,9 +413,9 @@ evaluateRuns <- function(model, mydir, gitPath, compScen, email, mattermostToken
if(length(runsStarted) < 1) errorList <- c(errorList, "No runs started")

if(is.null(errorList)) {
summary <- paste0("Summary of ", today, ": Tests look good")
summary <- paste0("Summary: AMT runs look good.")
} else {
summary <- paste0("Summary of ", today, ": ", paste0(unlist(unique(errorList)), collapse = ". "))
summary <- paste0("Summary: ", paste0(unlist(unique(errorList)), collapse = ". "))
}

write(summary, myfile, append = TRUE)
Expand All @@ -434,27 +434,25 @@ evaluateRuns <- function(model, mydir, gitPath, compScen, email, mattermostToken
message <- NULL
if (model == "REMIND") {
rs2 <- utils::capture.output(loopRuns(runsStarted, user = NULL, colors = FALSE, sortbytime = FALSE))
message <- paste0("Please find below the status of the REMIND automated model tests (AMT) of ", today, ":")
message <- paste0("Please find below the status of the REMIND automated model tests (AMT) of ", today, ". Runs are here: `/p/projects/remind/modeltests/remind`.")
message <- c(message, summary)
message <- c(message, testthatResult)
message <- c(message, "```", gitInfo, "```")
message <- c(message, "`rs2 -t` returns:")
message <- c(message, "```", rs2, "```")
message <- c(message, summary)
if (exists("runsNotStarted")) {
message <- c(message, "These scenarios did not start at all:", runsNotStarted)
}
}
if (!is.null(errorList)) {
if (!is.null(errorList) && model == "MAgPIE") {
message <- c(message, paste0("Some ",
model,
" tests produce warnings. Please check ",
"https://gitlab.pik-potsdam.de/",
ifelse(model == "MAgPIE", "landuse", model),
"/testing_suite",
ifelse(model == "REMIND", " or `rs2 -t`", "")
"/testing_suite"
))
}
if (exists("testthatResult")) {
message <- c(message, testthatResult)
}

if (!is.null(message)) {
message <- paste0(message, collapse = "\n") # put each vector element into new line
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Run Analysis Tools

R package **modelstats**, version **0.21.1**
R package **modelstats**, version **0.21.2**

[![CRAN status](https://www.r-pkg.org/badges/version/modelstats)](https://cran.r-project.org/package=modelstats) [![R build status](https://github.com/pik-piam/modelstats/workflows/check/badge.svg)](https://github.com/pik-piam/modelstats/actions) [![codecov](https://codecov.io/gh/pik-piam/modelstats/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/modelstats) [![r-universe](https://pik-piam.r-universe.dev/badges/modelstats)](https://pik-piam.r-universe.dev/builds)

Expand Down Expand Up @@ -47,7 +47,7 @@ In case of questions / problems please contact Anastasis Giannousakis <giannou@p

To cite package **modelstats** in publications use:

Giannousakis A, Richters O (2024). _modelstats: Run Analysis Tools_. R package version 0.21.1, <https://github.com/pik-piam/modelstats>.
Giannousakis A, Richters O (2024). _modelstats: Run Analysis Tools_. R package version 0.21.2, <https://github.com/pik-piam/modelstats>.

A BibTeX entry for LaTeX users is

Expand All @@ -56,7 +56,7 @@ A BibTeX entry for LaTeX users is
title = {modelstats: Run Analysis Tools},
author = {Anastasis Giannousakis and Oliver Richters},
year = {2024},
note = {R package version 0.21.1},
note = {R package version 0.21.2},
url = {https://github.com/pik-piam/modelstats},
}
```

0 comments on commit b591590

Please sign in to comment.