<commit_before># A complete set of daymetr unit tests
# to ensure that code changes do not break
# the functionality and download behaviour.
# This allows checks to see if server paths
# are still ok, and if overall the functions
# don't act up.

# standard pixel extraction test
test_that("pixel location download check",{
  
  # download the data
  df = try(download_daymet(start = 1980,
                           end = 1980,
                           internal = TRUE,
                           quiet = TRUE))
  
  # check if no error occured
  expect_true(!inherits(df,"try-error"))
})

# check single tile download
test_that("tile download checks",{
  
  # download the data
  df = try(download_daymet_tiles(path = tempdir(),
                                 param = "tmin"))
  
  # check if no error occured
  expect_true(!inherits(df,"try-error"))
})

# freeform gridded data download check
test_that("freefrom gridded download (ncss) checks",{
  
  # download the data
  df_daily = try(download_daymet_ncss(param = "tmin",
                                frequency = "daily",
                                path = tempdir()))
  
  # download the data
  df_monthly = try(download_daymet_ncss(param = "tmin",
                                      frequency = "monthly",
                                      path = tempdir()))

  # download the data
  df_annual = try(download_daymet_ncss(param = "tmin",
                                        frequency = "annual",
                                        path = tempdir()))
  
  # see if any of the runs failed
  check = any(!inherits(df_daily,"try-error") |
              !inherits(df_monthly,"try-error") |
              !inherits(df_annual,"try-error"))
  
  # check if no error occured
  expect_true(check)
})

# check the calculation of a mean values
test_that("freefrom gridded download (ncss) checks",{
  
  # download the data
  try(download_daymet_ncss(param = c("tmin","tmax"),
                           frequency = "monthly",
                           path = tempdir()))
  
  tmean = try(daymet_grid_tmean(path = tempdir(),
                                product = "monavg",
                                year = 1988))
  
  # check if no error occured
  expect_true(!inherits(tmean,"try-error"))
})

<commit_msg>correction in unit testing<commit_after># A complete set of daymetr unit tests
# to ensure that code changes do not break
# the functionality and download behaviour.
# This allows checks to see if server paths
# are still ok, and if overall the functions
# don't act up.

# standard pixel extraction test
test_that("pixel location download check",{
  
  # download the data
  df = try(download_daymet(start = 1980,
                           end = 1980,
                           internal = TRUE,
                           quiet = TRUE))
  
  # check if no error occured
  expect_true(!inherits(df,"try-error"))
})

# check single tile download
test_that("tile download checks",{
  
  # download the data
  df = try(download_daymet_tiles(path = tempdir(),
                                 param = "tmin"))
  
  # check if no error occured
  expect_true(!inherits(df,"try-error"))
})

# freeform gridded data download check
test_that("freefrom gridded download (ncss) checks",{
  
  # download the data
  df_daily = try(download_daymet_ncss(param = "tmin",
                                frequency = "daily",
                                path = tempdir()))
  
  # download the data
  df_monthly = try(download_daymet_ncss(param = "tmin",
                                      frequency = "monthly",
                                      path = tempdir()))

  # download the data
  df_annual = try(download_daymet_ncss(param = "tmin",
                                        frequency = "annual",
                                        path = tempdir()))
  
  # see if any of the runs failed
  check = any(!inherits(df_daily,"try-error") |
              !inherits(df_monthly,"try-error") |
              !inherits(df_annual,"try-error"))
  
  # check if no error occured
  expect_true(check)
})

# check the calculation of a mean values
test_that("freefrom gridded download (ncss) checks",{
  
  # download the data
  try(download_daymet_ncss(param = c("tmin","tmax"),
                           frequency = "monthly",
                           path = tempdir()))
  
  tmean = try(daymet_grid_tmean(path = tempdir(),
                                product = "monavg",
                                year = 1980))
  
  # check if no error occured
  expect_true(!inherits(tmean,"try-error"))
})


{'fraction_non_alphanumeric': 0.09627532128076671, 'fraction_numerical': 0.005227619255064256, 'mean_word_length': 1.8451053283767038, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 52, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1748325', 'n_tokens_mistral': 1305, 'n_tokens_neox': 1255, 'n_words': 359}