Skip to content

Commit

Permalink
was this the only problem
Browse files Browse the repository at this point in the history
Merge branch 'master' of github.com:AustralianAntarcticDivision/SOmap

# Conflicts:
#	DESCRIPTION
#	NEWS.md
  • Loading branch information
mdsumner committed Mar 27, 2024
2 parents 6cde418 + 7db58bb commit f469173
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 20 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# 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:
Expand All @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
Expand All @@ -29,11 +29,11 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
Expand All @@ -43,8 +43,11 @@ jobs:
if: runner.os == 'macOS'
run: brew install pkg-config gdal proj geos

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v1
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
32 changes: 26 additions & 6 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# 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:
Expand All @@ -15,16 +15,36 @@ jobs:
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
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: covr
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: covr::codecov()
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: SOmap
Type: Package
Title: Southern Ocean maps
Version: 0.6.2.9001
Version: 0.6.2.9002
Authors@R: c(person("Dale", "Maschette", email = "dale.maschette@aad.gov.au", role = c("aut", "cre")),
person("Michael", "Sumner", role = "aut"),
person("Ben", "Raymond", role = "aut"))
Expand All @@ -12,7 +12,7 @@ License: GPL (>= 2)
Encoding: UTF-8
LazyData: true
LazyDataCompression: xz
RoxygenNote: 7.2.0
RoxygenNote: 7.2.3
Roxygen: list(markdown = TRUE)
Depends: R (>= 3.6.0), raster, sp
Imports:
Expand All @@ -31,7 +31,7 @@ Imports:
spex (>= 0.6.0),
stars,
terra,
vapour (>= 0.8.5),
vapour (>= 0.9.5),
tabularaster,
tibble,
uuid
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

* add rgdal to Remotes so it can install from github

* Changed underlying method of getting background bathymetry for SOmap_auto().

* GEBCO COG updated from 2019 local workaround to more permanent GEBCO 2023 (we should dep on hypertidy/dsn to keep this up to date).

# 0.6

Expand Down
1 change: 1 addition & 0 deletions R/SOmap_auto.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ SOmap_auto_inner <- function(x, y, centre_lon, centre_lat, target, dimXY, bathy,

## automap_maker ----
amap <- automap_maker(x, y = y, centre_lon = centre_lon, centre_lat = centre_lat, target = target, dimXY = dimXY, expand = expand)

xy <- amap$xy
target <- amap$target
prj <- raster::projection(target)
Expand Down
13 changes: 10 additions & 3 deletions R/new_automap.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.get_raad_gebco <- function(target) {
src <- getOption("SOmap.auto.topography.source")
if (is.null(src)) {
## secret squirrel
src <- "/vsicurl/http://data.raadsync.cloud.edu.au/gebco/GEBCO_2019.tif"

src <- "/vsicurl/https://gebco2023.s3.valeria.science/gebco_2023_land_cog.tif"
}
ri <- vapour::vapour_raster_info(src)$projection
if (nchar(ri) < 1) {
Expand All @@ -14,8 +14,14 @@
ext <- c(raster::xmin(target), raster::xmax(target), raster::ymin(target), raster::ymax(target))
dm <- dim(target)[2:1]
proj <- raster::projection(target)

## change from vapour_warp_raster to gdal_raster_data
if (!is.null(source_projection)) src <- vapour::vapour_vrt(src, projection = source_projection)

op <- options(warn = -1)
on.exit(options(op), add = TRUE)
raster::setValues(target,
vapour::vapour_warp_raster(src, extent = ext, dimension = dm, projection = proj, resample = "cubic", source_wkt = source_projection)[[1L]])
vapour::gdal_raster_data(src, target_ext = ext, target_dim = dm, target_crs = proj, resample = "cubic")[[1L]])
}
family_proj <- function(family = NULL, clon = NULL, clat = NULL, true_scale = NULL,
secant_range = NULL) {
Expand Down Expand Up @@ -236,6 +242,7 @@ automap_maker <-


bathymetry <- try(.get_raad_gebco(tgt_raster), silent = TRUE)

if (inherits(bathymetry, "try-error")) {
bathymetry <- crunch_bathy(tgt_raster)
}
Expand Down

0 comments on commit f469173

Please sign in to comment.