Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to sf, terra and fmesher #82

Merged
merged 56 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
afc8a40
Start converting vignette to terra and sf
timcdlucas May 2, 2023
281fb2f
Vignette preamble now terra.
timcdlucas May 22, 2023
cfd5659
Replaced gBuffer with sf equivalent even though Im not 100pc its needed.
timcdlucas May 22, 2023
7f8197c
Mid work, working through prepare_data making it terra
timcdlucas May 22, 2023
93b65cd
Old change, but adding what changed made for 0.2.0.
timcdlucas May 22, 2023
7c3ee57
Switch parallelExtract to 1 core terra.
timcdlucas May 31, 2023
b8770df
Currently broken. raster extract wasnt adding proper polygon id column.
timcdlucas May 31, 2023
f1497a4
Fix parallelExtract rows id issue.
timcdlucas May 31, 2023
2f74d59
Convert build_mesh to sf
timcdlucas May 31, 2023
74aacfa
Fix plot.disag_data
timcdlucas May 31, 2023
405cf74
Continue updating vignette
timcdlucas Jun 2, 2023
c217476
Change imports in description to match new backends.
timcdlucas Jun 5, 2023
0f9cbbc
Fix small bug in extract.
timcdlucas Jun 5, 2023
2cbd6f6
Update some docs to use sf.
timcdlucas Jun 5, 2023
63f0633
And some tidyup.
timcdlucas Jun 5, 2023
0e53f67
Remove raster from some print and summary functions.
timcdlucas Jun 5, 2023
783ad21
Remove raster from some print and summary functions.
timcdlucas Jun 5, 2023
66d6bb8
First pass at removing raster from predict. Currently makes massive n…
timcdlucas Jun 5, 2023
e334b3d
Line endings.
timcdlucas Jun 5, 2023
cb40b81
line endings.
timcdlucas Jun 5, 2023
be450ed
migrate prepare_data to terra/sf
simon-smart88 Sep 13, 2023
b2bff70
more terra migration
simon-smart88 Sep 13, 2023
91d7cad
migrate test-extract and minor git fixes
simon-smart88 Sep 15, 2023
ba3a522
migrate test-prepare-data and further migration in prepare_data
simon-smart88 Sep 15, 2023
0b83bd7
start to migrate test-fit-model
simon-smart88 Sep 15, 2023
0a095c2
more test migration, migrate to fmesher, update docs
simon-smart88 Oct 10, 2023
4130016
fix predict tests and remove some dependencies
simon-smart88 Oct 10, 2023
aca877b
move test data to helper_data
simon-smart88 Oct 10, 2023
b412537
update examples and docs. remove sp from imports
simon-smart88 Oct 10, 2023
6ad196c
partially migrate plotting (not functional yet)
simon-smart88 Oct 11, 2023
793077b
migrate summary
simon-smart88 Oct 11, 2023
268e7e0
update prepare docs
simon-smart88 Oct 13, 2023
3d2cc96
fix id_var handling in prepare_data
simon-smart88 Oct 13, 2023
e6a0576
switch plotting to use tidyterra and update some docs
simon-smart88 Oct 16, 2023
b1874a5
update docs after migration
simon-smart88 Oct 16, 2023
225c866
Update prepare_data.R
simon-smart88 Oct 23, 2023
5ff89dc
Update fit_model.R
simon-smart88 Oct 23, 2023
1db8d22
migrate INLA::inla.mesh.project to fmesher::fm_evaluate
simon-smart88 Oct 23, 2023
9d66d11
remove getamatrix function
simon-smart88 Oct 23, 2023
ad953fa
tweaks to yesterdays changes
simon-smart88 Oct 24, 2023
bedcb09
deprectate ncores
simon-smart88 Oct 24, 2023
dc94f28
fix prepare bug
simon-smart88 Oct 31, 2023
4df4c4d
Update vignette
simon-smart88 Oct 31, 2023
ee0a1c0
update readme
simon-smart88 Oct 31, 2023
ca2a9d1
update description
simon-smart88 Oct 31, 2023
ffd1711
adjust test-extract
simon-smart88 Oct 31, 2023
7ef6593
replace skip_if_not_installed('INLA')
simon-smart88 Oct 31, 2023
17aa2ca
add missing skip inla and update prepare docs
simon-smart88 Nov 1, 2023
fa9f1d5
another missing INLA skip
simon-smart88 Nov 1, 2023
e867911
remove INLA requirement from prepare data
simon-smart88 Nov 7, 2023
0e2031c
remove foreach dependency
simon-smart88 Nov 7, 2023
8e0e63a
fix long lines in docs
simon-smart88 Nov 7, 2023
166b085
improve vignette plot
simon-smart88 Nov 7, 2023
3b80068
add missing suggest
simon-smart88 Nov 7, 2023
d8a5e1b
tweak priors
simon-smart88 Nov 7, 2023
3acb727
Merge pull request #2 from simon-smart88/terra
timcdlucas Jan 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
^.*\.Rproj$
^\.Rproj\.user$
^\.git*
README.md
.travis.yml
vignettes/disaggregation_cache/*
cran-comments.md
^\.github$
.github/workflows/R-CMD-check-HTML5.archyaml
^.*\.Rproj$
^\.Rproj\.user$
^\.git*
README.md
.travis.yml
vignettes/disaggregation_cache/*
cran-comments.md
^\.github$
.github/workflows/R-CMD-check-HTML5.archyaml
vignettes/spatio_temporal_disaggregation.Rmd
116 changes: 58 additions & 58 deletions .github/workflows/R-CMD-check-HTML5.yaml
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
# 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:
push:
branches: [html5]
pull_request:
branches: [html5]

name: R-CMD-check-html5


jobs:
HTML5-check:
runs-on: ubuntu-latest
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
extra-repositories: "https://inla.r-inla-download.org/R/stable"


- name: Install pdflatex
run: sudo apt-get install texlive-latex-base texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra

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

- name: Install system dependencies on MacOS (X11, gdal)
if: runner.os == 'macOS'
run: |
brew install --cask xquartz
brew install pkg-config
brew install proj@8
brew install gdal

- uses: r-lib/actions/setup-r-dependencies@v2
with:
dependencies: '"all"'
extra-packages: |
rcmdcheck

- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- uses: r-lib/actions/check-r-package@v2
with:
args: '"--as-cran"'
build_args: 'character()'
#error-on: '"note"'
# 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:
push:
branches: [html5]
pull_request:
branches: [html5]
name: R-CMD-check-html5
jobs:
HTML5-check:
runs-on: ubuntu-latest
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
extra-repositories: "https://inla.r-inla-download.org/R/stable"
- name: Install pdflatex
run: sudo apt-get install texlive-latex-base texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra
- uses: r-lib/actions/setup-pandoc@v2
- name: Install system dependencies on MacOS (X11, gdal)
if: runner.os == 'macOS'
run: |
brew install --cask xquartz
brew install pkg-config
brew install proj@8
brew install gdal
- uses: r-lib/actions/setup-r-dependencies@v2
with:
dependencies: '"all"'
extra-packages: |
rcmdcheck
- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
- uses: r-lib/actions/check-r-package@v2
with:
args: '"--as-cran"'
build_args: 'character()'
#error-on: '"note"'
190 changes: 95 additions & 95 deletions .github/workflows/R-CMD-check-no-suggests.yaml
Original file line number Diff line number Diff line change
@@ -1,96 +1,96 @@
# 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
#
# Largely copied from: https://github.com/inlabru-org/inlabru/blob/devel/.github/workflows/R-CMD-check-no-suggests.yaml
# Want to test without suggests to ensure things don't fail on cran when INLA isn't there.

on:
push:
branches:
'**'
pull_request:
branches:
- devel
- master

name: R-CMD-check-no-suggests

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release'}
# - {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 }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
extra-repositories: "https://inla.r-inla-download.org/R/testing"

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

- name: Install system dependencies on MacOS (X11, gdal)
if: runner.os == 'macOS'
run: |
brew install --cask xquartz
brew install pkg-config
brew install proj@9
brew install gdal

- name: Has inla? Check.
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
"INLA" %in% pkgs
shell: Rscript {0}

- uses: r-lib/actions/setup-r-dependencies@v2
with:
dependencies: '"hard"'
extra-packages: |
rcmdcheck
testthat

- name: Has inla? Check, and remove.
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
"INLA" %in% pkgs
if ("INLA" %in% pkgs) {
remove.packages("INLA")
}
shell: Rscript {0}

- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- uses: r-lib/actions/check-r-package@v2
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
_R_CHECK_FORCE_SUGGESTS_: false
with:
build_args: 'c("--no-manual", "--no-build-vignettes")'
args: 'c("--no-manual", "--ignore-vignettes", "--as-cran")'



# 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
#
# Largely copied from: https://github.com/inlabru-org/inlabru/blob/devel/.github/workflows/R-CMD-check-no-suggests.yaml
# Want to test without suggests to ensure things don't fail on cran when INLA isn't there.
on:
push:
branches:
'**'
pull_request:
branches:
- devel
- master
name: R-CMD-check-no-suggests
jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release'}
# - {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 }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
extra-repositories: "https://inla.r-inla-download.org/R/testing"
- uses: r-lib/actions/setup-pandoc@v2
- name: Install system dependencies on MacOS (X11, gdal)
if: runner.os == 'macOS'
run: |
brew install --cask xquartz
brew install pkg-config
brew install proj@9
brew install gdal
- name: Has inla? Check.
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
"INLA" %in% pkgs
shell: Rscript {0}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
dependencies: '"hard"'
extra-packages: |
rcmdcheck
testthat
- name: Has inla? Check, and remove.
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
"INLA" %in% pkgs
if ("INLA" %in% pkgs) {
remove.packages("INLA")
}
shell: Rscript {0}
- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
- uses: r-lib/actions/check-r-package@v2
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
_R_CHECK_FORCE_SUGGESTS_: false
with:
build_args: 'c("--no-manual", "--no-build-vignettes")'
args: 'c("--no-manual", "--ignore-vignettes", "--as-cran")'

20 changes: 10 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
inst/doc
.Rproj.user
.Rhistory
.Rproj
.RData
*.o
*.so
vignettes/disaggregation_cache/*
vignettes/disaggregation_files/*
.github/workflows/R-CMD-check-HTML5.archyaml
inst/doc
.Rproj.user
.Rhistory
.Rproj
.RData
*.o
*.so
vignettes/disaggregation_cache/*
vignettes/disaggregation_files/*
.github/workflows/R-CMD-check-HTML5.archyaml
vignettes/spatio_temporal_disaggregation.Rmd
15 changes: 7 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
Package: disaggregation
Type: Package
Title: Disaggregation Modelling
Version: 0.2.1
Version: 0.3.0
Authors@R: c(
person("Anita", "Nandi", email = "[email protected]", role = "aut", comment = c(ORCID = "0000-0002-5087-2494")),
person("Tim", "Lucas", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-4694-8107")),
person("Rohan", "Arambepola", email = "[email protected]", role = "aut"),
person("Andre", "Python", email = "[email protected]", role = "aut", comment = c(ORCID = "0000-0001-8094-7226"))
person("Andre", "Python", email = "[email protected]", role = "aut", comment = c(ORCID = "0000-0001-8094-7226")),
person("Simon", "Smart", email = "[email protected]", role = "ctb")
)
Description: Fits disaggregation regression models using 'TMB' ('Template Model
Builder'). When the response data are aggregated to polygon level but
Expand All @@ -18,12 +19,6 @@ Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.3
Imports:
raster,
foreach,
sp,
sf,
parallel,
doParallel,
splancs,
Matrix,
stats,
Expand All @@ -32,6 +27,10 @@ Imports:
ggplot2,
cowplot,
sparseMVN,
fmesher,
tidyterra,
terra,
sf,
utils
Additional_repositories: https://inla.r-inla-download.org/R/stable
Suggests:
Expand Down
Loading
Loading