From 6f724af842b7a50606172610225e1d128767ff97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luise=20Quo=C3=9F?= Date: Thu, 11 Jul 2024 16:01:36 +0200 Subject: [PATCH] minor --- R/ebv_metadata.R | 6 +++--- tests/testthat/test-ebv_metadata.R | 12 +++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/R/ebv_metadata.R b/R/ebv_metadata.R index 647fb81..2c4c734 100644 --- a/R/ebv_metadata.R +++ b/R/ebv_metadata.R @@ -213,13 +213,13 @@ ebv_metadata <- function(outputpath, title, summary, } } - if(scenario_no>0 && is.null(ebv_scenario_classification_name)){ + if(scenario_no>0 && is.null(ebv_scenario_classification_name) && verbose){ warning('You defined at least one scenario but did not define the ebv_scenario_classification_name. Are you sure you do not want to give that information?') } - if(scenario_no>0 && is.null(ebv_scenario_classification_version)){ + if(scenario_no>0 && is.null(ebv_scenario_classification_version & verbose)){ warning('You defined at least one scenario but did not define the ebv_scenario_classification_version. Are you sure you do not want to give that information?') } - if(scenario_no>0 && is.null(ebv_scenario_classification_url)){ + if(scenario_no>0 && is.null(ebv_scenario_classification_url & verbose)){ warning('You defined at least one scenario but did not define the ebv_scenario_classification_url. Are you sure you do not want to give that information?') } diff --git a/tests/testthat/test-ebv_metadata.R b/tests/testthat/test-ebv_metadata.R index 7696e0f..cf4ef17 100644 --- a/tests/testthat/test-ebv_metadata.R +++ b/tests/testthat/test-ebv_metadata.R @@ -31,7 +31,8 @@ test_that("test ebv_metadata scenario&metric", { list(standard_name='absolute change habitat', long_name='absolute change since year 1800', units='square kilometers')), # scenario = list(standard_name='SSP1', long_name='description of SSP1') scenario = list(list(standard_name='SSP1', long_name='description of SSP1'), - list(standard_name='SSP2', long_name='description of SSP2')) + list(standard_name='SSP2', long_name='description of SSP2')), + verbose = FALSE ) @@ -86,11 +87,12 @@ test_that("test ebv_metadata metric only", { creator_institution = 'lame name', contributor_name = c('me', 'you', 'her'), license = 'CC BY', + ebv_entity_type = 'Species', + ebv_entity_scope = '50 mammal species', comment = 'anything else you have to say', - ebv_class = 'None', - ebv_name = 'None', - ebv_spatial_scope = 'Continental', - ebv_spatial_description = 'Finland', + ebv_class = 'Genetic composition', + ebv_name = 'Intraspecific genetic diversity', + ebv_spatial_scope = 'Global', ebv_domain = c('Terrestrial','Marine'), coverage_content_type = c('modelResult'), time_coverage_start = as.Date('1900-01-01'), time_coverage_end =as.Date('1950-01-01'), time_coverage_resolution = 'Irregular',