Skip to content

Commit adf58a2

Browse files
committed
preliminary merge alloc-params into main
2 parents ed20ba1 + 2d5ca98 commit adf58a2

39 files changed

+1516
-255
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ air.toml
99
^_pkgdown\.yml$
1010
^docs$
1111
^pkgdown$
12+
^.devcontainer$

.devcontainer/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM --platform=linux/amd64 ghcr.io/mmyrte/evoland:latest
2+
LABEL authors="Carlson Büth, Jan Hartman" \
3+
version="8.3" \
4+
description="Docker image for Dinamica EGO."
5+
6+
# Vignettes are being built with quarto
7+
RUN /rocker_scripts/install_quarto.sh
8+
9+
# Hand-knitted dependency discovery from DESCRIPTION avoids cache invalidation versus a
10+
# remotes::install_deps based solution.
11+
WORKDIR /builddir
12+
COPY DESCRIPTION /builddir/DESCRIPTION
13+
COPY .devcontainer/install_pkg_deps.r /builddir/install_pkg_deps.r
14+
RUN /builddir/install_pkg_deps.r && rm -r /builddir
15+
WORKDIR /
16+
17+
# Install development dependencies for vscode-style development.
18+
COPY .devcontainer/install_vscode_devtools.sh /rocker_scripts/install_vscode_devtools.sh
19+
RUN /rocker_scripts/install_vscode_devtools.sh

.devcontainer/devcontainer.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.191.1/containers/debian
3+
{
4+
"name": "evoland-devcontainer",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"context": "..",
8+
"args": {
9+
"platform": "linux/amd64"
10+
}
11+
},
12+
"mounts": [
13+
{
14+
"source": "${localEnv:EVOLAND_CACHEDIR}",
15+
"target": "/mnt/evoland-cache",
16+
"type": "bind"
17+
}
18+
],
19+
"containerEnv": {
20+
"EVOLAND_CACHEDIR": "/mnt/evoland-cache"
21+
},
22+
"customizations": {
23+
"vscode": {
24+
"settings": {
25+
"git.path": "/usr/bin/git",
26+
"r.rterm.linux": "/usr/local/bin/radian",
27+
"shellcheck.executablePath": "/usr/bin/shellcheck",
28+
"r.plot.useHttpgd": true,
29+
"r.bracketedPaste": true,
30+
"rewrap.wrappingColumn": 88
31+
},
32+
"extensions": [
33+
"RDebugger.r-debugger",
34+
"REditorSupport.r",
35+
"quarto.quarto",
36+
"timonwong.shellcheck"
37+
]
38+
}
39+
}
40+
}

.devcontainer/install_pkg_deps.r

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env Rscript
2+
3+
# Reusing logic from remotes::local_package_deps
4+
# MIT licensed, source at https://github.com/r-lib/remotes/
5+
6+
desc <- remotes:::read_dcf("DESCRIPTION")
7+
8+
dependencies <- c("Depends", "Imports", "LinkingTo", "Suggests")
9+
dependencies <- intersect(dependencies, names(desc))
10+
pkg_deps <-
11+
lapply(desc[dependencies], remotes:::parse_deps) |>
12+
lapply(`[[`, "name") |>
13+
unlist(use.names = FALSE)
14+
15+
pkgs_to_install <- setdiff(pkg_deps, installed.packages()[, 1])
16+
install.packages(
17+
pkgs_to_install,
18+
Ncpus = max(1L, parallel::detectCores())
19+
)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
3+
# Abort script if any command exits with non-zero status. Not foolproof.
4+
set -e
5+
6+
NCPUS=${NCPUS:-"-1"}
7+
8+
apt-get update -qq
9+
apt-get -y --no-install-recommends install \
10+
git \
11+
htop \
12+
libfontconfig1-dev \
13+
libfribidi-dev \
14+
libgit2-dev \
15+
libharfbuzz-dev \
16+
pipx \
17+
shellcheck
18+
19+
rm -rf /var/lib/apt/lists/*
20+
21+
PIPX_BIN_DIR=/usr/local/bin pipx install radian
22+
23+
install2.r --error --skipinstalled -n $NCPUS \
24+
covr \
25+
devtools \
26+
languageserver \
27+
lobstr \
28+
microbenchmark \
29+
profvis \
30+
quarto \
31+
rlang
32+
33+
# httpgd is currently off of CRAN because of c++ compiler conflicts
34+
# https://github.com/nx10/httpgd/issues/218
35+
36+
R -e "remotes::install_github('nx10/httpgd')"

.github/workflows/R-CMD-check.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
workflow_dispatch:
7+
8+
name: R-CMD-check.yaml
9+
10+
permissions: read-all
11+
12+
jobs:
13+
R-CMD-check:
14+
runs-on: ${{ matrix.config.os }}
15+
16+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
config:
22+
- { os: macos-latest, r: "release" }
23+
# - {os: windows-latest, r: 'release'}
24+
# - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
25+
- { os: ubuntu-latest, r: "release" }
26+
# - { os: ubuntu-24.04-arm, r: "release" }
27+
# - {os: ubuntu-latest, r: 'oldrel-1'}
28+
29+
env:
30+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
31+
R_KEEP_PKG_SOURCE: yes
32+
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- uses: r-lib/actions/setup-pandoc@v2
37+
38+
- uses: r-lib/actions/setup-r@v2
39+
with:
40+
r-version: ${{ matrix.config.r }}
41+
http-user-agent: ${{ matrix.config.http-user-agent }}
42+
use-public-rspm: true
43+
44+
- name: Install macOS system dependencies
45+
if: runner.os == 'macos'
46+
run: brew install gdal proj
47+
48+
- uses: r-lib/actions/setup-r-dependencies@v2
49+
with:
50+
extra-packages: any::rcmdcheck
51+
needs: check
52+
53+
- uses: r-lib/actions/check-r-package@v2
54+
with:
55+
upload-snapshots: true
56+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/pkgdown.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
on:
44
push:
55
branches: [main, master]
6-
pull_request:
76
release:
87
types: [published]
98
workflow_dispatch:

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,11 @@ docs
5656

5757
# generally ignore databases, like .evolanddb, .duckdb, anything.db
5858
*db
59+
60+
# IDE specific artefacts
61+
*compile_commands*
62+
*cobertura*
63+
.cache/
64+
65+
# ignore drafts
66+
*suddel*

DESCRIPTION

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,28 @@ URL: https://ethzplus.github.io/evoland-plus, https://github.com/ethzplus/evolan
1010
BugReports: https://github.com/ethzplus/evoland-plus/issues
1111
Encoding: UTF-8
1212
Roxygen: list(markdown = TRUE)
13-
RoxygenNote: 7.3.2
13+
RoxygenNote: 7.3.3
1414
Depends:
1515
R (>= 4.2)
1616
Imports:
1717
curl,
1818
data.table,
1919
DBI,
20-
duckdb,
20+
duckdb (>= 1.4.3),
2121
glue,
22-
purrr,
2322
qs2,
2423
R6,
2524
Rcpp,
26-
rlang,
2725
stringi,
2826
terra
2927
Suggests:
28+
base64enc,
3029
butcher,
3130
pROC,
32-
tinytest,
31+
processx,
3332
quarto,
34-
ranger
33+
ranger,
34+
tinytest
3535
VignetteBuilder: quarto
3636
Config/testthat/edition: 3
3737
LinkingTo:
@@ -56,11 +56,13 @@ Collate:
5656
'periods_t.R'
5757
'pred_data_t.R'
5858
'pred_meta_t.R'
59+
'reporting_t.R'
5960
'trans_meta_t.R'
6061
'trans_models_glm.R'
6162
'trans_models_rf.R'
6263
'trans_models_t.R'
6364
'trans_preds_t.R'
6465
'util.R'
66+
'util_dinamica.r'
6567
'util_download.R'
6668
'util_terra.R'

NAMESPACE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ S3method(validate,pred_data_t_bool)
3030
S3method(validate,pred_data_t_float)
3131
S3method(validate,pred_data_t_int)
3232
S3method(validate,pred_meta_t)
33+
S3method(validate,reporting_t)
3334
S3method(validate,trans_meta_t)
3435
S3method(validate,trans_models_t)
3536
S3method(validate,trans_preds_t)
@@ -43,6 +44,7 @@ export(as_neighbors_t)
4344
export(as_periods_t)
4445
export(as_pred_data_t)
4546
export(as_pred_meta_t)
47+
export(as_reporting_t)
4648
export(as_trans_meta_t)
4749
export(as_trans_models_t)
4850
export(as_trans_preds_t)
@@ -57,6 +59,7 @@ export(create_pred_meta_t)
5759
export(create_trans_meta_t)
5860
export(download_and_verify)
5961
export(evoland_db)
62+
export(exec_dinamica)
6063
export(extract_using_coords_t)
6164
export(fit_glm)
6265
export(fit_ranger)
@@ -65,6 +68,7 @@ export(gof_ranger)
6568
export(grrf_filter)
6669
export(parquet_duckdb)
6770
export(print_rowwise_yaml)
71+
export(run_evoland_dinamica_sim)
6872
export(validate)
6973
importFrom(Rcpp,sourceCpp)
7074
importFrom(data.table,":=")

0 commit comments

Comments
 (0)