Skip to content

Commit cabcf7d

Browse files
committed
pubmed result sorting bugfix
1 parent fc6e403 commit cabcf7d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

server/preprocessing/other-scripts/metrics.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ mlog <- getLogger("metrics")
88
enrich_metadata_metrics <- function(metadata, metrics_sources=c("altmetric", "crossref")) {
99
start.time <- Sys.time()
1010

11+
original_sorting <- metadata$id
12+
1113
if ("altmetric" %in% metrics_sources) {
1214
metadata <- add_altmetrics(metadata)
1315
}
@@ -18,6 +20,9 @@ enrich_metadata_metrics <- function(metadata, metrics_sources=c("altmetric", "cr
1820
# Remove duplicate lines - TODO: check for root of this problem
1921
metadata <- unique(metadata)
2022

23+
# restore original sorting
24+
metadata <- metadata[match(original_sorting, metadata$id), ]
25+
2126
end.time <- Sys.time()
2227
time.taken <- end.time - start.time
2328
mlog$info(paste("vis_id:", .GlobalEnv$VIS_ID, "Time taken:", time.taken, sep = " "))

0 commit comments

Comments
 (0)