From e660e00101e64fa72e84d5a9157aaddece00d053 Mon Sep 17 00:00:00 2001 From: Han Chen Date: Mon, 19 Apr 2021 15:19:29 +0800 Subject: [PATCH] 0.6.0 release --- .github/workflows/R-CMD-check.yaml | 61 ++++++++++-------------------- DESCRIPTION | 3 -- R/convertCoord.R | 2 - R/helpers.R | 34 ----------------- README.Rmd | 4 +- README.md | 4 +- amapGeocode.Rproj | 2 +- man/convertCoord.Rd | 3 -- man/parallel_cluster_maker.Rd | 27 ------------- 9 files changed, 25 insertions(+), 115 deletions(-) delete mode 100644 man/parallel_cluster_maker.Rd diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index fb4fc50..fb7b370 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,7 +1,3 @@ -# NOTE: This workflow is overkill for most R packages -# check-standard.yaml is likely a better choice -# usethis::use_github_action("check-standard") will install it. -# # For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. # https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions on: @@ -26,17 +22,13 @@ jobs: fail-fast: false matrix: config: - - {os: macOS-latest, r: 'release'} - {os: windows-latest, r: 'release'} - - {os: windows-latest, r: '3.6'} - - {os: ubuntu-18.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.0.0 (ubuntu-18.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" } - - {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} - - {os: ubuntu-18.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} - - {os: ubuntu-18.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} - - {os: ubuntu-18.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} - - {os: ubuntu-18.04, r: '3.3', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} + - {os: macOS-latest, r: 'release'} + - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} env: + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true RSPM: ${{ matrix.config.rspm }} GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} @@ -44,64 +36,51 @@ jobs: - uses: actions/checkout@v2 - uses: r-lib/actions/setup-r@v1 - id: install-r with: r-version: ${{ matrix.config.r }} - http-user-agent: ${{ matrix.config.http-user-agent }} - uses: r-lib/actions/setup-pandoc@v1 - - name: Install pak and query dependencies + - name: Query dependencies run: | - install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") - saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds") + install.packages('remotes') + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") shell: Rscript {0} - name: Restore R package cache + if: runner.os != 'Windows' uses: actions/cache@v2 with: - path: | - ${{ env.R_LIBS_USER }}/* - !${{ env.R_LIBS_USER }}/pak - key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }} - restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1- + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - name: Install system dependencies if: runner.os == 'Linux' run: | - pak::local_system_requirements(execute = TRUE) - pak::pkg_system_requirements("rcmdcheck", execute = TRUE) - shell: Rscript {0} + while read -r cmd + do + eval sudo $cmd + done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') - name: Install dependencies run: | - pak::local_install_dev_deps(upgrade = TRUE) - pak::pkg_install("rcmdcheck") - shell: Rscript {0} - - - name: Session info - run: | - options(width = 100) - pkgs <- installed.packages()[, "Package"] - sessioninfo::session_info(pkgs, include_base = TRUE) + remotes::install_deps(dependencies = TRUE) + remotes::install_cran("rcmdcheck") shell: Rscript {0} - name: Check env: - _R_CHECK_CRAN_INCOMING_: false + _R_CHECK_CRAN_INCOMING_REMOTE_: false run: | options(crayon.enabled = TRUE) rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") shell: Rscript {0} - - name: Show testthat output - if: always() - run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash - - name: Upload check results if: failure() uses: actions/upload-artifact@main with: - name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results + name: ${{ runner.os }}-r${{ matrix.config.r }}-results path: check diff --git a/DESCRIPTION b/DESCRIPTION index a5453cf..b992ff4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -22,7 +22,6 @@ Imports: stats, xml2, data.table, - lifecycle, furrr Suggests: stringr, @@ -34,9 +33,7 @@ Suggests: VignetteBuilder: knitr Encoding: UTF-8 -LazyData: true RoxygenNote: 7.1.1 -RdMacros: lifecycle Language: en-US URL: https://github.com/womeimingzi11/amapGeocode BugReports: https://github.com/womeimingzi11/amapGeocode/issues diff --git a/R/convertCoord.R b/R/convertCoord.R index e66da36..53551f3 100644 --- a/R/convertCoord.R +++ b/R/convertCoord.R @@ -1,7 +1,5 @@ #' Convert coordinate from different coordinate systems to AutoNavi system #' -#' \Sexpr[results=rd]{lifecycle::badge("experimental")}\cr -#' #' This function is a wrap of coordinate convert API of AutoNavi Map Service.\cr #' While how to input the origin coordinate is sill unstable and #' 95\% sure that it will have a breaking change in the future. diff --git a/R/helpers.R b/R/helpers.R index 5ef97b0..f1f9ac3 100644 --- a/R/helpers.R +++ b/R/helpers.R @@ -27,37 +27,3 @@ num_coord_to_str_loc <- function(lng, lat) { # should be lower than 6 paste(round(lng, 6), round(lat, 6), sep = ",") } - -#' Create a local parallel cluster -#' (NOT WORK) -#' -#' \Sexpr[results=rd]{lifecycle::badge("deprecated")}\cr -#' -#' The parallel framework has been transported to `furrr`, -#' `parallel_cluster_maker` function does not work anymore since v0.5.1 -#' -#' @param max_core Optional \cr -#' A threshold of max cores for parallel operation. -#' There is no need to set a `max_core` generally. -#' But for some extreme high performance case, -#' like `AMD Threadripper` and `Intel Xeon`, -#' super multiple-core CPU will meet the limitation of queries per second. -#' @return -#' A local parallel cluster -parallel_cluster_maker <- function(max_core = NULL) { - # detect the number of logical cores - # generally, to avoid the OS stuck, we often drop at least 1 core. - # however, http request is really - # a light weight task for modern device, - # we use all the cores to speed up the request. - if (is.null(max_core)) { - core_num <- - parallel::detectCores() - } else { - core_num <- - parallel::detectCores() - core_num <- - ifelse(core_num > max_core, max_core, core_num) - } - parallel::makeCluster(core_num) -} diff --git a/README.Rmd b/README.Rmd index c113f29..b6ce1e8 100644 --- a/README.Rmd +++ b/README.Rmd @@ -22,7 +22,7 @@ knitr::opts_chunk$set( [![Total downloads badge](https://cranlogs.r-pkg.org/badges/grand-total/amapGeocode?color=blue)](https://CRAN.R-project.org/package=amapGeocode) [![CRAN status](https://www.r-pkg.org/badges/version/amapGeocode)](https://CRAN.R-project.org/package=amapGeocode) -[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing) +[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html#maturing) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![DOI](https://zenodo.org/badge/297431889.svg)](https://zenodo.org/badge/latestdoi/297431889) [![Codecov test coverage](https://codecov.io/gh/womeimingzi11/amapGeocode/branch/master/graph/badge.svg)](https://codecov.io/gh/womeimingzi11/amapGeocode?branch=master) @@ -45,7 +45,7 @@ However, AutoNavi has significant high precise, in my case, the Results from Bai ## BIG NEWS: Parallel is Here! But you need a `plan` -Since `v0.5.1`, parallel framework is implemented by [`furrr` package](https://CRAN.R-project.org/package=furrr), of which backend is [`future package`](https://arxiv.org/abs/2008.00553). Refering to [*A Future for R: Best Practices for Package Developers*](https://cran.r-project.org/web/packages/future/vignettes/future-7-for-package-developers.html) and avoiding potential modification to the future strategy, we have removed the automatically parallel operation from every function in `amapGeocode`. +Since `v0.5.1`, parallel framework is implemented by [`furrr` package](https://CRAN.R-project.org/package=furrr), of which backend is [`future package`](https://arxiv.org/abs/2008.00553). Refering to [*A Future for R: Best Practices for Package Developers*](https://CRAN.R-project.org/package=future/vignettes/future-7-for-package-developers.html) and avoiding potential modification to the future strategy, we have removed the automatically parallel operation from every function in `amapGeocode`. To turn on parallel operation support, just call `future::plan(multisession) # or any other future strategy`. diff --git a/README.md b/README.md index cfaeb9c..8d9edb9 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ badge](https://cranlogs.r-pkg.org/badges/grand-total/amapGeocode?color=blue)](ht [![CRAN status](https://www.r-pkg.org/badges/version/amapGeocode)](https://CRAN.R-project.org/package=amapGeocode) [![Lifecycle: -maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing) +maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html#maturing) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![DOI](https://zenodo.org/badge/297431889.svg)](https://zenodo.org/badge/latestdoi/297431889) @@ -68,7 +68,7 @@ Since `v0.5.1`, parallel framework is implemented by [`furrr` package](https://CRAN.R-project.org/package=furrr), of which backend is [`future package`](https://arxiv.org/abs/2008.00553). Refering to [*A Future for R: Best Practices for Package -Developers*](https://cran.r-project.org/web/packages/future/vignettes/future-7-for-package-developers.html) +Developers*](https://CRAN.R-project.org/package=future/vignettes/future-7-for-package-developers.html) and avoiding potential modification to the future strategy, we have removed the automatically parallel operation from every function in `amapGeocode`. diff --git a/amapGeocode.Rproj b/amapGeocode.Rproj index 673d3fe..ad8129f 100644 --- a/amapGeocode.Rproj +++ b/amapGeocode.Rproj @@ -10,7 +10,7 @@ NumSpacesForTab: 2 Encoding: UTF-8 RnwWeave: Sweave -LaTeX: XeLaTeX +LaTeX: pdfLaTeX AutoAppendNewline: Yes StripTrailingWhitespace: Yes diff --git a/man/convertCoord.Rd b/man/convertCoord.Rd index fd0b8fa..4760102 100644 --- a/man/convertCoord.Rd +++ b/man/convertCoord.Rd @@ -49,9 +49,6 @@ See \url{https://lbs.amap.com/api/webservice/guide/api/convert} for more information. } \description{ -\Sexpr[results=rd]{lifecycle::badge("experimental")}\cr -} -\details{ This function is a wrap of coordinate convert API of AutoNavi Map Service.\cr While how to input the origin coordinate is sill unstable and 95\% sure that it will have a breaking change in the future. diff --git a/man/parallel_cluster_maker.Rd b/man/parallel_cluster_maker.Rd deleted file mode 100644 index abfdbb6..0000000 --- a/man/parallel_cluster_maker.Rd +++ /dev/null @@ -1,27 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/helpers.R -\name{parallel_cluster_maker} -\alias{parallel_cluster_maker} -\title{Create a local parallel cluster -(NOT WORK)} -\usage{ -parallel_cluster_maker(max_core = NULL) -} -\arguments{ -\item{max_core}{Optional \cr -A threshold of max cores for parallel operation. -There is no need to set a `max_core` generally. -But for some extreme high performance case, -like `AMD Threadripper` and `Intel Xeon`, -super multiple-core CPU will meet the limitation of queries per second.} -} -\value{ -A local parallel cluster -} -\description{ -\Sexpr[results=rd]{lifecycle::badge("deprecated")}\cr -} -\details{ -The parallel framework has been transported to `furrr`, -`parallel_cluster_maker` function does not work anymore since v0.5.1 -}