diff --git a/.zenodo.json b/.zenodo.json index 4a901c7..554c423 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -3,7 +3,7 @@ { "orcid": "0000-0003-2561-4677", "affiliation": "University of Groningen", - "name": "Neves, Pedro" + "name": "Santos Neves, Pedro" }, { "orcid": "0000-0001-5218-3046", diff --git a/DESCRIPTION b/DESCRIPTION index 4f73f2f..5e6ad5f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: DAISIEutils Title: Utility Functions for the DAISIE Package Date: 2023-05-03 -Version: 1.6.0 +Version: 1.6.0.9000 Authors@R: c( person(given = "Pedro", family = "Santos Neves", diff --git a/NEWS.md b/NEWS.md index 5112b18..5f07efc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# DAISIEutils (development version) + +* Migrate from now defunct Peregrine HPCC to the new Hábrók HPCC + # DAISIEutils 1.6.0 * The version of R and DAISIE are incremented to 4.2 and 4.4.0, respectively diff --git a/R/create_output_folder.R b/R/create_output_folder.R index 9c16a2b..ef877a7 100644 --- a/R/create_output_folder.R +++ b/R/create_output_folder.R @@ -4,7 +4,7 @@ #' #' @return #' Creates appropriate directory. Returns string with path for output object. By -#' default, if on Peregrine, folder will be `$HOME/results/$data_name`. If +#' default, if on Hábrók, folder will be `$HOME/results/$data_name`. If #' called from another environment, folder will be #' `getwd()/results/$data_name`. Alternatively, another valid root can be #' specified, resulting in `results_dir/$data_name`. diff --git a/R/is_on_cluster.R b/R/is_on_cluster.R index 5d65953..3651e54 100644 --- a/R/is_on_cluster.R +++ b/R/is_on_cluster.R @@ -1,6 +1,6 @@ -#' Check if code is running on Peregrine HPCC +#' Check if code is running on Hábrók HPCC #' -#' @return Boolean. `TRUE` if called from Peregrine HPCC, FALSE if not. +#' @return Boolean. `TRUE` if called from Hábrók HPCC, FALSE if not. #' @export #' #' @examples @@ -8,7 +8,7 @@ #' #' @author Pedro Santos Neves is_on_cluster <- function() { - if (identical(Sys.getenv("HOSTNAME"), "peregrine.hpc.rug.nl")) { + if (identical(Sys.getenv("SLURM_CLUSTER_NAME"), "habrok")) { return(TRUE) } else { return(FALSE) diff --git a/man/create_output_folder.Rd b/man/create_output_folder.Rd index c3959bb..b965ddd 100644 --- a/man/create_output_folder.Rd +++ b/man/create_output_folder.Rd @@ -23,7 +23,7 @@ not saved to file.} } \value{ Creates appropriate directory. Returns string with path for output object. By -default, if on Peregrine, folder will be \verb{$HOME/results/$data_name}. If +default, if on Hábrók, folder will be \verb{$HOME/results/$data_name}. If called from another environment, folder will be \verb{getwd()/results/$data_name}. Alternatively, another valid root can be specified, resulting in \verb{results_dir/$data_name}. diff --git a/man/is_on_cluster.Rd b/man/is_on_cluster.Rd index a5b602a..23f355a 100644 --- a/man/is_on_cluster.Rd +++ b/man/is_on_cluster.Rd @@ -2,15 +2,15 @@ % Please edit documentation in R/is_on_cluster.R \name{is_on_cluster} \alias{is_on_cluster} -\title{Check if code is running on Peregrine HPCC} +\title{Check if code is running on Hábrók HPCC} \usage{ is_on_cluster() } \value{ -Boolean. \code{TRUE} if called from Peregrine HPCC, FALSE if not. +Boolean. \code{TRUE} if called from Hábrók HPCC, FALSE if not. } \description{ -Check if code is running on Peregrine HPCC +Check if code is running on Hábrók HPCC } \examples{ on_cluster <- is_on_cluster() diff --git a/tests/testthat/test-is_on_cluster.R b/tests/testthat/test-is_on_cluster.R index 616a62c..ec3aa00 100644 --- a/tests/testthat/test-is_on_cluster.R +++ b/tests/testthat/test-is_on_cluster.R @@ -1,17 +1,17 @@ test_that("use", { # If HOSTNAME - if (identical(Sys.getenv("HOSTNAME"), "peregrine.hpc.rug.nl")) { + if (identical(Sys.getenv("SLURM_CLUSTER_NAME"), "habrok")) { expect_true(is_on_cluster()) - Sys.unsetenv("HOSTNAME") + Sys.unsetenv("SLURM_CLUSTER_NAME") expect_false(is_on_cluster()) - Sys.setenv(HOSTNAME = "peregrine.hpc.rug.nl") + identical(Sys.getenv("SLURM_CLUSTER_NAME"), "habrok") } else { - stored_hostname <- Sys.getenv("HOSTNAME") + stored_cluster_name <- Sys.getenv("SLURM_CLUSTER_NAME") expect_false(is_on_cluster()) - Sys.setenv(HOSTNAME = "peregrine.hpc.rug.nl") + Sys.setenv(SLURM_CLUSTER_NAME = "habrok") expect_true(is_on_cluster()) - Sys.setenv(HOSTNAME = stored_hostname) + Sys.setenv(SLURM_CLUSTER_NAME = stored_cluster_name) } })