quanteda / spacyr
Showing 1 of 2 files from the diff.
Other files ignored by Codecov

@@ -499,19 +499,29 @@
Loading
499 499
#'   A vector of multiple model names can be used (e.g. \code{c("en_core_web_sm", "de_core_web_sm")})
500 500
#' @param prompt logical; ask whether to proceed during the installation
501 501
#' @param envname character; name of conda environment to upgrade spaCy
502 +
#' @param update_conda logical; If \code{true}, the conda binary for the system will be updated to the latest version. 
503 +
#'  Default \code{FALSE}.
502 504
#' @export
503 505
spacy_upgrade  <- function(conda = "auto",
504 506
                           envname = "spacy_condaenv",
505 507
                           prompt = TRUE,
506 508
                           pip = FALSE,
509 +
                           update_conda = FALSE,
507 510
                           lang_models = "en_core_web_sm") {
508 511
509 -
    message("checking spaCy version")
510 512
    conda <- reticulate::conda_binary(conda)
511 513
    if (!(envname %in% reticulate::conda_list(conda = conda)$name)) {
512 514
        message("Conda evnronment", envname, "does not exist")
513 515
    }
514 -
516 +
    
517 +
    if (update_conda == TRUE) {
518 +
        message("Update conda binary")
519 +
        args <- reticulate:::conda_args("update", "root", "conda")
520 +
        result <- system2(conda, shQuote(args))
521 +
        message("Conda is updated\n")
522 +
    }
523 +
    
524 +
    message("checking spaCy version")
515 525
    condaenv_bin <- function(bin) path.expand(file.path(dirname(conda), bin))
516 526
    cmd <- sprintf("%s%s %s && pip search spacy%s",
517 527
                   ifelse(is_windows(), "", ifelse(is_osx(), "source ", "/bin/bash -c \"source ")),
@@ -658,3 +668,4 @@
Loading
658 668
    #version_check_regex <- sprintf(".+(%s.\\d+\\.\\d+).+", major_version)
659 669
    return(result[length(result)])
660 670
}
671 +
Files Coverage
R 65.24%
Project Totals (13 files) 65.24%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading