From 5b784eae315dedfa58c800df222d38d58c233788 Mon Sep 17 00:00:00 2001 From: Tomas Kalibera Date: Wed, 18 Oct 2023 13:37:03 +0200 Subject: [PATCH 1/2] Avoid re-opening already opened NetCDF file. --- R/netCDFwriteCD.R | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/R/netCDFwriteCD.R b/R/netCDFwriteCD.R index ecfff799..b35d5d9f 100644 --- a/R/netCDFwriteCD.R +++ b/R/netCDFwriteCD.R @@ -160,12 +160,18 @@ } -.stopWriteCDF <- function(x) { +.writeRangeCDF <- function(x) { + nc <- ncdf4::nc_open(x@file@name, write=TRUE) on.exit( ncdf4::nc_close(nc) ) ncdf4::ncatt_put(nc, x@title, 'min', as.numeric(x@data@min)) ncdf4::ncatt_put(nc, x@title, 'max', as.numeric(x@data@max)) +} + + +.stopWriteCDF <- function(x) { + .writeRangeCDF(x) if (inherits(x, 'RasterBrick')) { r <- brick(x@file@name) } else { From 15ebe8fb77bf70de7554aad5656415a5a3baf7fa Mon Sep 17 00:00:00 2001 From: Krzysztof Dyba <35004826+kadyb@users.noreply.github.com> Date: Fri, 27 Oct 2023 16:12:32 +0200 Subject: [PATCH 2/2] bump dependencies in pkgdown workflow --- .github/workflows/pkgdown.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 81feca1c..be273338 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -12,11 +12,11 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 - - uses: r-lib/actions/setup-pandoc@v1 + - uses: r-lib/actions/setup-pandoc@v2 - name: Install spatial dependencies run: brew install gdal @@ -29,7 +29,7 @@ jobs: shell: Rscript {0} - name: Restore R package cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ env.R_LIBS_USER }} key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}