Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
LuiseQuoss committed Jul 11, 2024
1 parent 5f0798f commit 6f724af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions R/ebv_metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -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?')
}

Expand Down
12 changes: 7 additions & 5 deletions tests/testthat/test-ebv_metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -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

)

Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 6f724af

Please sign in to comment.