Skip to content

Commit

Permalink
fix dataset descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
rcannood committed Nov 29, 2024
1 parent 25905ec commit e87140d
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 71 deletions.
37 changes: 20 additions & 17 deletions results/_include/_baseline_descriptions.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,28 @@ lines <- pmap_chr(baselines, function(method_name, method_summary, method_descri
references_doi <- pluck(rest, "references_doi", .default = NULL)
references_bibtex <- pluck(rest, "references_bibtex", .default = NULL)
if ("paper_reference" %in% names(rest)) {
ref <- split_cite_fun(rest$paper_reference)
} else {
bibs <- c()
if (!is.null(references_doi) && !is.na(references_doi)) {
bibs <- get_bibtex_from_doi(references_doi)
}
if (!is.null(references_bibtex) && !is.na(references_bibtex)) {
bibs <- c(bibs, references_bibtex)
}
# Write new entries to library.bib
write_library(bibs)
# Get bibtex references
if (!is.null(bibs)) {
ref <- get_bibtex_entries(bibs)
ref <-
if ("paper_reference" %in% names(rest)) {
split_cite_fun(rest$paper_reference)
} else {
bibs <- c()
if (!is.null(references_doi) && !is.na(references_doi)) {
bibs <- get_bibtex_from_doi(references_doi)
}
if (!is.null(references_bibtex) && !is.na(references_bibtex)) {
bibs <- c(bibs, references_bibtex)
}
# Write new entries to library.bib
write_library(bibs)
# Get bibtex references
if (!is.null(bibs)) {
get_bibtex_entries(bibs)
} else {
""
}
} else {
ref <- ""
""
}
}
if (ref != "") ref <- paste0(" ", ref)
Expand Down
40 changes: 21 additions & 19 deletions results/_include/_dataset_descriptions.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,34 @@ lines <- pmap_chr(dataset_info, function(dataset_id, dataset_name, dataset_summa
date_created <- pluck(rest, "date_created", .default = NULL)
file_size <- pluck(rest, "file_size", .default = NULL)
if (grep("^[a-zA-Z0-9]+[0-9]{4}[a-z]+$",data_reference) && !grepl("^@",data_reference)) {
ref <- split_cite_fun(data_reference)
} else {
bibs <- convert_to_bibtex(data_reference)
# Write new entries to library.bib
write_library(bibs)
ref <- get_bibtex_entries(bibs)
}
ref <-
if (grepl("^[a-zA-Z0-9]+[0-9]{4}[a-z]+$", data_reference) && !grepl("^@", data_reference)) {
split_cite_fun(data_reference)
} else {
bibs <- convert_to_bibtex(data_reference)
# Write new entries to library.bib
write_library(bibs)
get_bibtex_entries(bibs)
}
if (ref != "") ref <- paste0(" ", ref)
dataset_link <- if (!is.null(source_dataset_id) && dir.exists(paste0("../../datasets/", source_dataset_id))) {
glue::glue("../../datasets/{source_dataset_id}")
} else if (dir.exists(paste0("../../datasets/", dataset_id))) {
glue::glue("../../datasets/{dataset_id}")
} else {
NULL
}
dataset_link <-
if (!is.null(source_dataset_id) && dir.exists(paste0("../../datasets/", source_dataset_id))) {
glue::glue("../../datasets/{source_dataset_id}")
} else if (dir.exists(paste0("../../datasets/", dataset_id))) {
glue::glue("../../datasets/{dataset_id}")
} else {
NULL
}
# Make file_size human readable
if (!is.null(file_size)) {
file_size_str <- format(
structure(file_size, class = "object_size"),
units = "auto",
standard = "IEC",
digits = 2
structure(file_size, class = "object_size"),
units = "auto",
standard = "IEC",
digits = 2
)
}
Expand Down
36 changes: 19 additions & 17 deletions results/_include/_method_descriptions.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,27 @@ lines <- pmap_chr(method_info %>% filter(!is_baseline), function(method_name, me
code_version <- pluck(rest, "code_version", .default = NULL)
references_doi <- pluck(rest, "references_doi", .default = NULL)
references_bibtex <- pluck(rest, "references_bibtex", .default = NULL)
if ("paper_reference" %in% names(rest)) {
ref <- split_cite_fun(rest$paper_reference)
} else {
bibs <- c()
if (!is.null(references_doi) && !is.na(references_doi)) {
bibs <- get_bibtex_from_doi(references_doi)
}
if (!is.null(references_bibtex) && !is.na(references_bibtex)) {
bibs <- c(bibs, references_bibtex)
}
# Write new entries to library.bib
write_library(bibs)
# Get bibtex references
if (!is.null(bibs)) {
ref <- get_bibtex_entries(bibs)
ref <-
if ("paper_reference" %in% names(rest)) {
split_cite_fun(rest$paper_reference)
} else {
ref <- ""
bibs <- c()
if (!is.null(references_doi) && !is.na(references_doi)) {
bibs <- get_bibtex_from_doi(references_doi)
}
if (!is.null(references_bibtex) && !is.na(references_bibtex)) {
bibs <- c(bibs, references_bibtex)
}
# Write new entries to library.bib
write_library(bibs)
# Get bibtex references
if (!is.null(bibs)) {
get_bibtex_entries(bibs)
} else {
""
}
}
}
if (ref != "") ref <- paste0(" ", ref)
Expand Down
38 changes: 20 additions & 18 deletions results/_include/_metric_descriptions.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,28 @@ lines <- pmap_chr(metric_info, function(metric_name, metric_summary, metric_desc
code_version <- pluck(rest, "code_version", .default = NULL)
references_doi <- pluck(rest, "references_doi", .default = NULL)
references_bibtex <- pluck(rest, "references_bibtex", .default = NULL)
if ("paper_reference" %in% names(rest)) {
ref <- split_cite_fun(rest$paper_reference)
} else {
bibs <- c()
if (!is.null(references_doi) && !is.na(references_doi)) {
bibs <- get_bibtex_from_doi(references_doi)
}
if (!is.null(references_bibtex) && !is.na(references_bibtex)) {
bibs <- c(bibs, references_bibtex)
}
# Write new entries to library.bib
write_library(bibs)
# Get bibtex references
if (!is.null(bibs)) {
ref <- get_bibtex_entries(bibs)
ref <-
if ("paper_reference" %in% names(rest)) {
split_cite_fun(rest$paper_reference)
} else {
ref <- ""
bibs <- c()
if (!is.null(references_doi) && !is.na(references_doi)) {
bibs <- get_bibtex_from_doi(references_doi)
}
if (!is.null(references_bibtex) && !is.na(references_bibtex)) {
bibs <- c(bibs, references_bibtex)
}
# Write new entries to library.bib
write_library(bibs)
# Get bibtex references
if (!is.null(bibs)) {
get_bibtex_entries(bibs)
} else {
""
}
}
}
if (ref != "") ref <- paste0(" ", ref)
Expand Down

0 comments on commit e87140d

Please sign in to comment.