tests/testthat/test-bechefa.R

test_that("Bechefa stand runs correctly", {
  
  data(data_bechefa, package = "SamsaRaLight")
  
  inv <- data_bechefa$trees
  sensors <- data_bechefa$sensors
  info <- data_bechefa$info
  
  expect_silent(check_coordinates(inv, verbose = FALSE))
  expect_silent(check_inventory(inv, verbose = FALSE))
  expect_silent(check_sensors(sensors, verbose = FALSE))
  
  stand <- create_sl_stand(
    inv,
    cell_size = 10,
    latitude = info$latitude,
    slope = info$slope,
    aspect = info$aspect,
    north2x = info$north2x,
    sensors = sensors,
    core_polygon_df = data_bechefa$core_polygon,
    modify_polygon = "none",
    fill_around = FALSE,
    verbose = FALSE
  )
  
  expect_s3_class(stand, "sl_stand")
  
  radiations <- data_bechefa$radiations
  expect_silent(check_monthly_radiations(radiations, verbose = FALSE))
  
  out <- run_sl(
    stand,
    radiations,
    sensors_only = FALSE,
    detailed_output = TRUE,
    parallel_mode = FALSE, 
    verbose = FALSE
  )
  
  expect_s3_class(out, "sl_output")
  expect_true(length(out) > 0)
  
})

Try the SamsaRaLight package in your browser

Any scripts or data that you put into this service are public.

SamsaRaLight documentation built on April 16, 2026, 5:08 p.m.