Skip to content

Commit

Permalink
Merge pull request #169 from tscheypidi/master
Browse files Browse the repository at this point in the history
let PUC creation use madrat specific tmpdir
  • Loading branch information
FelicitasBeier authored May 8, 2023
2 parents ef26d3a + 5377a70 commit 625b75f
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 10 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ cran-comments.md
^.idea$
^Makefile$
^.*CITATION.cff$
^CRAN-SUBMISSION$
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '6426750'
ValidationKey: '6449535'
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: 'madrat: May All Data be Reproducible and Transparent (MADRaT) *'
version: 3.3.0
date-released: '2023-04-28'
version: 3.3.1
date-released: '2023-05-08'
abstract: Provides a framework which should improve reproducibility and transparency
in data processing. It provides functionality such as automatic meta data creation
and management, rudimentary quality management, data caching, work-flow management
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: madrat
Title: May All Data be Reproducible and Transparent (MADRaT) *
Version: 3.3.0
Date: 2023-04-28
Version: 3.3.1
Date: 2023-05-08
Authors@R: c(
person("Jan Philipp", "Dietrich", , "dietrich@pik-potsdam.de", role = c("aut", "cre")),
person("Lavinia", "Baumstark", , "lavinia@pik-potsdam.de", role = "aut"),
Expand Down
17 changes: 17 additions & 0 deletions R/madTempDir.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#' madTempDir
#'
#' returns a temporary directory as a subfolder of the tempfolder set in
#' \code{getConfig("tmpfolder")}.
#' @return path to the temp folder
#' @author Jan Philipp Dietrich
#' @seealso \code{\link{getConfig}}
#' @examples
#' \dontrun{
#' madrat:::madTempDir()
#' }
#'
madTempDir <- function() {
d <- file.path(getConfig("tmpfolder"), basename(tempdir()))
if (!dir.exists(d)) dir.create(d)
return(d)
}
2 changes: 1 addition & 1 deletion R/pucAggregate.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ pucAggregate <- function(puc, regionmapping = getConfig("regionmapping"), ..., r
.verbose = FALSE)
do.call(retrieveData, c(cfg$args, list(renv = FALSE)))
}
})
}, tmpdir = madTempDir())
toolendmessage(startinfo)
}
2 changes: 1 addition & 1 deletion R/retrieveData.R
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ retrieveData <- function(model, rev = 0, dev = "", cachetype = "def", puc = iden
vcat(1, "puc file not created, some cache files are missing:\n",
paste(missingFiles, collapse = "\n"))
}
})
}, tmpdir = madTempDir())
} else {
vcat(1, "puc file not created: could not find all relevant files.")
}
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# May All Data be Reproducible and Transparent (MADRaT) *

R package **madrat**, version **3.3.0**
R package **madrat**, version **3.3.1**

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

Expand Down Expand Up @@ -55,7 +55,7 @@ In case of questions / problems please contact Jan Philipp Dietrich <dietrich@pi

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

Dietrich J, Baumstark L, Wirth S, Giannousakis A, Rodrigues R, Bodirsky B, Kreidenweis U, Klein D, Führlich P (2023). _madrat: May All Data be Reproducible and Transparent (MADRaT)_. doi:10.5281/zenodo.1115490 <https://doi.org/10.5281/zenodo.1115490>, R package version 3.3.0, <https://github.com/pik-piam/madrat>.
Dietrich J, Baumstark L, Wirth S, Giannousakis A, Rodrigues R, Bodirsky B, Kreidenweis U, Klein D, Führlich P (2023). _madrat: May All Data be Reproducible and Transparent (MADRaT)_. doi: 10.5281/zenodo.1115490 (URL: https://doi.org/10.5281/zenodo.1115490), R package version 3.3.1, <URL: https://github.com/pik-piam/madrat>.

A BibTeX entry for LaTeX users is

Expand All @@ -64,7 +64,7 @@ A BibTeX entry for LaTeX users is
title = {madrat: May All Data be Reproducible and Transparent (MADRaT)},
author = {Jan Philipp Dietrich and Lavinia Baumstark and Stephen Wirth and Anastasis Giannousakis and Renato Rodrigues and Benjamin Leon Bodirsky and Ulrich Kreidenweis and David Klein and Pascal Führlich},
year = {2023},
note = {R package version 3.3.0},
note = {R package version 3.3.1},
doi = {10.5281/zenodo.1115490},
url = {https://github.com/pik-piam/madrat},
}
Expand Down
27 changes: 27 additions & 0 deletions man/madTempDir.Rd

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

0 comments on commit 625b75f

Please sign in to comment.