Skip to content

Commit

Permalink
move data type check after the version detection
Browse files Browse the repository at this point in the history
  • Loading branch information
e-kotov committed Aug 9, 2024
1 parent 797d8ec commit d1a1e52
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/download_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ spod_download_data <- function(
quiet = FALSE,
return_output = TRUE
) {
# convert english data type names to spanish words used in the default data paths
type <- match.arg(type)
type <- spod_match_data_type(type = type, ver = ver)

# convert english zone names to spanish words used in the default data paths
zones <- match.arg(zones)
zones <- spod_zone_names_en2es(zones)
Expand All @@ -56,6 +52,10 @@ spod_download_data <- function(
ver <- spod_infer_data_v_from_dates(dates_to_use) # this leads to a second call to an internal spod_get_valid_dates() which in turn causes a second call to spod_available_data_v1() or spod_get_metadata(). This results in reading the xml files with metadata for the second time. This is not optimal and should be fixed.
if (isFALSE(quiet)) message("Data version detected from dates: ", ver)

# convert english data type names to spanish words used in the default data paths
type <- match.arg(type)
type <- spod_match_data_type(type = type, ver = ver)



# get the available data list while checking for files already cached on disk
Expand Down

0 comments on commit d1a1e52

Please sign in to comment.