Skip to content

Commit 21966e1

Browse files
Merge branch 'alice/model-grafs-spain' into alice/typologies
2 parents 2daf52f + 4a006f7 commit 21966e1

98 files changed

Lines changed: 3645 additions & 3438 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.Rbuildignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
^renv$
22
^renv\.lock$
3-
^WHEP.Rproj$
3+
^whep.Rproj$
44
^LICENSE\.md$
55
^docs$
66
^\.github$
@@ -10,3 +10,8 @@
1010
^\.Rproj\.user$
1111
^data-raw$
1212
^README\.Rmd$
13+
^cran-comments\.md$
14+
^CRAN-SUBMISSION$
15+
^air.toml$
16+
^doc$
17+
^Meta$

.Renviron

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
_R_CHECK_SYSTEM_CLOCK_=0
2+
RENV_CONFIG_PAK_ENABLED=TRUE
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Workflow derived from https://github.com/posit-dev/setup-air/tree/main/examples
2+
3+
on:
4+
# Using `pull_request_target` over `pull_request` for elevated `GITHUB_TOKEN`
5+
# privileges, otherwise we can't set `pull-requests: write` when the pull
6+
# request comes from a fork, which is our main use case (external contributors).
7+
#
8+
# `pull_request_target` runs in the context of the target branch (`main`, usually),
9+
# rather than in the context of the pull request like `pull_request` does. Due
10+
# to this, we must explicitly checkout `ref: ${{ github.event.pull_request.head.sha }}`.
11+
# This is typically frowned upon by GitHub, as it exposes you to potentially running
12+
# untrusted code in a context where you have elevated privileges, but they explicitly
13+
# call out the use case of reformatting and committing back / commenting on the PR
14+
# as a situation that should be safe (because we aren't actually running the untrusted
15+
# code, we are just treating it as passive data).
16+
# https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
17+
pull_request_target:
18+
19+
name: format-suggest.yaml
20+
21+
jobs:
22+
format-suggest:
23+
name: format-suggest
24+
runs-on: ubuntu-latest
25+
26+
permissions:
27+
# Required to push suggestion comments to the PR
28+
pull-requests: write
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
ref: ${{ github.event.pull_request.head.sha }}
34+
35+
- name: Install
36+
uses: posit-dev/setup-air@v1
37+
38+
- name: Format
39+
run: air format .
40+
41+
- name: Suggest
42+
uses: reviewdog/action-suggester@v1
43+
with:
44+
level: error
45+
fail_level: error
46+
tool_name: air

.github/workflows/lint.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ jobs:
2828
needs: lint
2929

3030
- name: Lint
31-
run: lintr::lint_package(linters=lintr::linters_with_defaults(object_usage_linter=NULL))
31+
run: |
32+
lintr::lint_package(
33+
linters = lintr::linters_with_defaults(
34+
object_usage_linter = NULL,
35+
line_length_linter = NULL
36+
)
37+
)
3238
shell: Rscript {0}
3339
env:
3440
LINTR_ERROR_ON_LINT: true

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@
99
inst/google_cloud_key.json
1010
inst/doc
1111
docs
12+
/doc/
13+
/Meta/

DESCRIPTION

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
1-
Package: WHEP
2-
Title: Who Has Eaten the Planet
3-
Version: 0.0.0.9000
1+
Package: whep
2+
Title: Processing Agro-Environmental Data
3+
Version: 0.1.0.9000
44
Authors@R: c(
55
person("Catalin", "Covaci", , "catalin.covaci@csic.es", role = c("aut", "cre"), comment = c(ORCID = "0009-0005-2186-5972")),
6-
person("Eduardo", "Aguilera", , "eduardo.aguilera@csic.es", role = c("aut"), comment = c(ORCID = "0000-0003-4382-124X")),
6+
person("Eduardo", "Aguilera", , "eduardo.aguilera@csic.es", role = c("aut", "cph"), comment = c(ORCID = "0000-0003-4382-124X")),
77
person("João", "Serra", , "jserra@agro.au.dk", role = c("ctb"), comment = c(ORCID = "0000-0002-3561-5350")),
8-
person("Alice", "Beckmann", , "alice.beckmann@cchs.csic.es", role = c("aut"), comment = c(ORCID = "0009-0009-6840-0258"))
8+
person("European Research Council", role = c("fnd"))
99
)
10-
Description: Gather historical agricultural and trade data from 1850.
10+
Description: A set of tools for processing and analyzing data developed in the
11+
context of the "Who Has Eaten the Planet" (WHEP) project, funded by the
12+
European Research Council (ERC). For more details on multi-regional
13+
input–output model "Food and Agriculture Biomass Input–Output" (FABIO) see
14+
Bruckner et al. (2019) <doi:10.1021/acs.est.9b03554>.
1115
License: MIT + file LICENSE
1216
Imports:
17+
cli,
1318
dplyr,
19+
fs,
1420
FAOSTAT,
15-
googledrive,
16-
httr2,
21+
httr,
1722
mipfp,
23+
nanoparquet,
24+
pins,
1825
purrr,
1926
readr,
2027
rlang,
2128
stringr,
2229
tidyr,
23-
readxl,
24-
sf,
25-
stringi,
26-
utils
30+
withr,
31+
yaml
2732
Encoding: UTF-8
2833
Roxygen: list(markdown = TRUE)
2934
RoxygenNote: 7.3.2
@@ -38,7 +43,8 @@ Suggests:
3843
tibble
3944
Config/testthat/edition: 3
4045
VignetteBuilder: knitr
41-
URL: https://eduaguilera.github.io/WHEP, https://github.com/eduaguilera/WHEP
42-
BugReports: https://github.com/eduaguilera/WHEP/issues
46+
URL: https://eduaguilera.github.io/whep/, https://github.com/eduaguilera/whep
47+
BugReports: https://github.com/eduaguilera/whep/issues
4348
Depends:
4449
R (>= 3.5)
50+
LazyData: true

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
YEAR: 2025
2-
COPYRIGHT HOLDER: WHEP authors
2+
COPYRIGHT HOLDER: whep authors

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT License
22

3-
Copyright (c) 2025 WHEP authors
3+
Copyright (c) 2025 whep authors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

LICENSE.note

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
The whep package as a whole is distributed under MIT. The whep package includes
2+
as part of their code some code taken from other R packages. The following is a
3+
list of these parts:
4+
5+
* whep: written by package authors
6+
* pins: Apache 2.0
7+
8+
A copy of the Apache 2.0 license can be found at inst/APACHE-LICENSE.md.

NAMESPACE

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Generated by roxygen2: do not edit by hand
22

3+
S3method(pin_fetch,pins_with_progress)
34
export(add_area_code)
45
export(add_area_name)
56
export(add_item_cbs_code)
@@ -11,13 +12,24 @@ export(create_n_inputs_grafs_spain)
1112
export(create_prod_and_destiny_grafs)
1213
export(create_typologies_grafs_spain)
1314
export(create_typologies_of_josette)
15+
export(calculate_nue_crops)
16+
export(calculate_nue_livestock)
17+
export(calculate_system_nue)
18+
export(create_alfredos_typologies)
19+
export(create_n_production)
20+
export(create_n_prov_destiny)
21+
export(create_n_soil_inputs)
22+
export(create_typologies_whep)
1423
export(expand_trade_sources)
1524
export(get_bilateral_trade)
1625
export(get_faostat_data)
1726
export(get_feed_intake)
18-
export(get_file_path)
1927
export(get_primary_production)
2028
export(get_primary_residues)
2129
export(get_processing_coefs)
2230
export(get_wide_cbs)
31+
export(plot_whep_typologies)
32+
export(whep_list_file_versions)
33+
export(whep_read_file)
34+
importFrom(pins,pin_fetch)
2335
importFrom(rlang,":=")

0 commit comments

Comments
 (0)