From e50d133413e3bd7fdc319b249c94d209c4424db5 Mon Sep 17 00:00:00 2001 From: Michael Sumner Date: Fri, 1 Dec 2023 01:33:17 +0000 Subject: [PATCH] flush --- .github/workflows/pkgdown.yaml | 60 ++++++++++++++++++---------------- R/proj_crs_text.R | 6 ++-- README.Rmd | 2 +- README.md | 6 ++-- vignettes/PROJ.Rmd | 4 ++- 5 files changed, 42 insertions(+), 36 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 8bc9210..ed7650c 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -1,46 +1,48 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - branches: master + branches: [main, master] + pull_request: + branches: [main, master] + release: + types: [published] + workflow_dispatch: name: pkgdown jobs: pkgdown: - runs-on: macOS-latest + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-pandoc@master - - - name: Query dependencies - run: | - 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} + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true - - name: Cache R packages - uses: actions/cache@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - 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- + extra-packages: any::pkgdown, local::. + needs: website - - name: Install dependencies - run: | - remotes::install_deps(dependencies = TRUE) - install.packages("pkgdown") + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) shell: Rscript {0} - - name: Install package - run: R CMD INSTALL . - - - name: Deploy package - run: | - git config --local user.email "actions@github.com" - git config --local user.name "GitHub Actions" - Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.4.1 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/R/proj_crs_text.R b/R/proj_crs_text.R index 348cf7d..20c9170 100644 --- a/R/proj_crs_text.R +++ b/R/proj_crs_text.R @@ -35,8 +35,10 @@ proj_crs_text <- function(source, format = 0L) { stopifnot(format %in% c(0L, 1L, 2L)) stopifnot(is.character(source)) stopifnot(length(source) == 1L) - .Call("C_proj_crs_text", + tst <- try(.Call("C_proj_crs_text", crs_ = source, format = as.integer(format), - PACKAGE = "PROJ") + PACKAGE = "PROJ"), silent = TRUE) + if (inherits(tst, "try-error")) return(NA_character_) + tst } diff --git a/README.Rmd b/README.Rmd index 9a7e5a4..f16229a 100644 --- a/README.Rmd +++ b/README.Rmd @@ -138,5 +138,5 @@ Geocentric transformations aren't used in R much, but some examples are found in --- Please note that the PROJ project is released with a - [Contributor Code of Conduct](https://github.com/hypertidy/PROJ/blob/master/CODE_OF_CONDUCT.md). + [Contributor Code of Conduct](https://github.com/hypertidy/PROJ/blob/main/CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms. diff --git a/README.md b/README.md index 7b7cc2c..d13d384 100644 --- a/README.md +++ b/README.md @@ -91,10 +91,10 @@ lat <- c(NA, 0, -42) proj_trans(cbind(lon, lat), src, source = dst) #> $x_ -#> [1] NA NA 147.0018 +#> [1] NaN NaN 147.0018 #> #> $y_ -#> [1] NA NA -42.00038 +#> [1] NaN NaN -42.00038 ``` A more realistic example with coastline map data. @@ -174,5 +174,5 @@ found in the [quadmesh](https://CRAN.R-project.org/package=quadmesh) and Please note that the PROJ project is released with a [Contributor Code of -Conduct](https://github.com/hypertidy/PROJ/blob/master/CODE_OF_CONDUCT.md). +Conduct](https://github.com/hypertidy/PROJ/blob/main/CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms. diff --git a/vignettes/PROJ.Rmd b/vignettes/PROJ.Rmd index 2fe5fb5..c5a622b 100644 --- a/vignettes/PROJ.Rmd +++ b/vignettes/PROJ.Rmd @@ -28,7 +28,7 @@ from version 6 and above. There's no other package in R that allows generic tran PROJ library, and this package provides that along with these goals: * no other dependencies (PROJ library is it, and R) -* allow geocentric transformations +* allow geocentric transformations, and 3D and 4D transformations generally. * provide no interpretation or restrictions on source or target projection specification * do not require special formats, we use numeric vectors in matrix or data frame form @@ -72,3 +72,5 @@ Note that various forms of projection string are supported, we can use PROJ.4 st The goal is for the [reproj package](https://CRAN.r-project.org/package=reproj) to wrap this package. In time that will be the easiest way to run coordinate transformations with PROJ for versions 4, 5, 6, 7 or above. + +