Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
7377f53
function for aux_cpi updated
shahronak47 Aug 23, 2025
a672f63
small fix
RossanaTat Aug 26, 2025
319695e
Merge branch 'pip-write-fns' into use_pins_rt
RossanaTat Aug 26, 2025
6369d4d
add force and meadatada paras to pip aux save plus some work on aux_cpi
RossanaTat Aug 26, 2025
3f16c9c
use pipload load aux in auc xpi
RossanaTat Aug 26, 2025
ade09fa
add wrk rel info in pipaux env on load
RossanaTat Aug 27, 2025
7d08157
more work on cpi funs
RossanaTat Aug 27, 2025
1418e77
init work on country list
RossanaTat Aug 27, 2025
9ffefea
update CL to use pins & match new Class file
RossanaTat Aug 28, 2025
4eec500
fix attr to aux cpi and aux cl
RossanaTat Aug 28, 2025
72174a5
new load and save censoring
RossanaTat Aug 28, 2025
d704606
save/load pin aux countries
RossanaTat Aug 28, 2025
0697c5f
same for pfw plus documentation
RossanaTat Aug 28, 2025
f98fe77
new aux country list from DEV
RossanaTat Aug 29, 2025
84fdb9c
new save/load for aux cp
RossanaTat Aug 29, 2025
1117a0e
same for aux dictionary
RossanaTat Aug 29, 2025
68f17e9
aux gdm updated -but validation fails
RossanaTat Aug 29, 2025
832acea
change [cn region to region as in dEV
RossanaTat Sep 2, 2025
a91c737
update incg group bc of new code in Class repo
RossanaTat Sep 2, 2025
81fe6e7
aux indicator -new load and save pins
RossanaTat Sep 2, 2025
e4a6254
clean commented code in aux labels
RossanaTat Sep 2, 2025
97d8fc3
aux maddison -new load and save
RossanaTat Sep 2, 2025
7b19e4b
same for aux metadata
RossanaTat Sep 2, 2025
6818622
fix
RossanaTat Sep 2, 2025
d6e473c
same for aux metaregion
RossanaTat Sep 2, 2025
5e978ef
same for aux missing data
RossanaTat Sep 2, 2025
113a221
smae for aux nan
RossanaTat Sep 2, 2025
ad91a4f
same for aux npl
RossanaTat Sep 2, 2025
77f2d86
same for aux pce
RossanaTat Sep 2, 2025
3599ca8
same for aux pl
RossanaTat Sep 2, 2025
147bbdf
same for pop
RossanaTat Sep 2, 2025
20f0ee9
update aux ppp
RossanaTat Sep 2, 2025
9efa4f4
do we need aux_proces ?
RossanaTat Sep 2, 2025
3e97bd1
aux regions update
RossanaTat Sep 2, 2025
32a5f25
aux sna updated
RossanaTat Sep 2, 2025
9128dcd
aux wdi updated
RossanaTat Sep 2, 2025
b6e68b0
aux weo updated
RossanaTat Sep 2, 2025
d3d3f5a
rm maindir from aux fun
RossanaTat Sep 2, 2025
c33e9f2
more work on aux funs and check status
RossanaTat Sep 3, 2025
a1a9b4a
issue of reading attr?
RossanaTat Sep 18, 2025
fdac52b
using util fun to read attr
RossanaTat Sep 18, 2025
3f72518
new fun for qs attr from pin
RossanaTat Sep 29, 2025
cfbec7e
clean code
RossanaTat Sep 30, 2025
2441834
add metadata board to pipaux env
RossanaTat Sep 30, 2025
f8ad7bb
update log save to pin board
RossanaTat Sep 30, 2025
31b6994
throw error in trycatch AND fix validation for country list
RossanaTat Oct 2, 2025
88860bf
from DEV: order cl data to get right unicode
RossanaTat Oct 2, 2025
26f27a3
from DEV: update pfw clean and missing data
RossanaTat Oct 2, 2025
966644f
ix pfw clean
RossanaTat Oct 2, 2025
d8331a5
fix pfw validate output
RossanaTat Oct 2, 2025
9f04eeb
fix issue with promise under eval in aux fun
RossanaTat Oct 8, 2025
12112af
update get aux changes
RossanaTat Oct 9, 2025
c38b549
update get last release function
RossanaTat Oct 9, 2025
042c6e0
update simulate old rel
RossanaTat Oct 23, 2025
ca51913
more work on identify changes plus fix issue in attr of cpi
RossanaTat Oct 24, 2025
e7eff85
util function to get aux board
RossanaTat Oct 27, 2025
1cff4b5
new version of simulate changes
RossanaTat Oct 27, 2025
4a9d388
fix identify changes to work with boards
RossanaTat Oct 27, 2025
9f9dd71
update comp of vintages
RossanaTat Oct 27, 2025
a011860
setting up new detect diff function?
RossanaTat Oct 28, 2025
718cf5b
identify missing or added rows
RossanaTat Oct 28, 2025
889b258
clean old options atn loading
RossanaTat Nov 3, 2025
ee081a1
fixes
RossanaTat Nov 7, 2025
8b39c81
more robust get aux changes
RossanaTat Nov 10, 2025
903b6c4
small fxes
RossanaTat Nov 10, 2025
a9651df
modify on load function
RossanaTat Dec 15, 2025
35d9093
update pip aux save
RossanaTat Dec 15, 2025
6eb8a5d
some fixes
RossanaTat Dec 16, 2025
65e5ff7
fix pip aux save
RossanaTat Dec 16, 2025
485471f
update all aux_ functions and rm old f from utils
RossanaTat Dec 16, 2025
b5b41df
rm old load aux
RossanaTat Dec 16, 2025
51aa731
rm old files
RossanaTat Dec 16, 2025
4865f41
update simulate changes
RossanaTat Dec 16, 2025
4f5cd6b
fixes to aux funs plus new aux cp clean
RossanaTat Dec 23, 2025
7870a0c
fix aux_metaregion
RossanaTat Dec 23, 2025
7d1e3ee
updated all funs in identify_changes -to be validated
RossanaTat Dec 23, 2025
d1658fb
more fixes to sim changes
RossanaTat Dec 26, 2025
a0136a9
fix gh attr in cpi
RossanaTat Dec 26, 2025
d2ca26e
fix get old release
RossanaTat Dec 26, 2025
ef5efb3
fix get aux changes
RossanaTat Dec 26, 2025
abdc7e3
new 3 refactored funs for check status
RossanaTat Dec 26, 2025
646fb31
NEW refactored aux fun in multiple funs
RossanaTat Dec 26, 2025
168af3a
fix problem in aux cp
RossanaTat Dec 27, 2025
c7ff8ff
new update aux data file again
RossanaTat Dec 27, 2025
05f6688
add reason in check status
RossanaTat Jan 14, 2026
93789ed
also update get fs status accoridngly
RossanaTat Jan 14, 2026
2824930
refactored update aux data file again
RossanaTat Jan 14, 2026
ec34b56
fix issue with log in uodate aux data
RossanaTat Jan 14, 2026
9e9a310
new update workflow vignette
RossanaTat Jan 14, 2026
f267cbe
update aux pipeline overview
RossanaTat Jan 14, 2026
eae5fb6
modifying aux_cpi to rely on sidecar and code arg from {stamp
RossanaTat Jan 20, 2026
924440d
using code label in aux cpi
RossanaTat Jan 20, 2026
ced2203
fix gh attr in aux cpi and in check status
RossanaTat Jan 21, 2026
db3b62e
gh and code sidecar addedd for ALL measures
RossanaTat Jan 21, 2026
c3d5b58
update pip aux save to use alias
RossanaTat Feb 9, 2026
cb6950c
fix reading of the alias
RossanaTat Feb 9, 2026
26677e1
fixes to use stamp aliases
RossanaTat Feb 9, 2026
d90186d
new shared processed env; updated update all aux fun; new use of logs
RossanaTat Feb 9, 2026
3726605
new function to plot dependencies from gh
RossanaTat Feb 9, 2026
4007fc4
correct plot...
RossanaTat Feb 9, 2026
d09fb2f
adding copilot md file, to be continued
RossanaTat Feb 10, 2026
af91df0
fix check status for GH owner-repo; fix log in aux fun; rm force for …
RossanaTat Feb 10, 2026
495c8cb
add functions to regulate stamp options
RossanaTat Feb 11, 2026
6bb59b5
deleting force option
RossanaTat Feb 11, 2026
e01a8b7
improve stamp_options.R file
RossanaTat Feb 12, 2026
3c9883c
fix check y status
RossanaTat Feb 12, 2026
2def5b3
fix check y status again
RossanaTat Feb 12, 2026
60acc33
fix problems with countries and missing data
RossanaTat Feb 12, 2026
c28ae1b
rmeove the fun raw sha attr
RossanaTat Feb 12, 2026
863de45
new functions for logs. plus modified aux fun accoridngly
RossanaTat Feb 13, 2026
13b9e42
logs version 0
RossanaTat Feb 17, 2026
77031d1
issue with recursive eval SOLVED
RossanaTat Feb 17, 2026
0b97400
documents utils logs fun
RossanaTat Feb 17, 2026
479c274
new update aux measures
RossanaTat Feb 17, 2026
3a2fa64
fix log save - to test
RossanaTat Feb 17, 2026
8d539f2
DELETE GDP WEO FUN
RossanaTat Feb 17, 2026
35c663d
new script for running the workflow update
RossanaTat Feb 18, 2026
925de3a
new tests on update aux measures
RossanaTat Feb 19, 2026
34fae34
trying log name w/out timestamp
RossanaTat Feb 20, 2026
21a2aae
add log in env in update aux measures wrapper
RossanaTat Feb 20, 2026
1767a8e
fix interactive test
RossanaTat Feb 20, 2026
92b8feb
modify check y status to handle multiple raw files for one measure
RossanaTat Feb 23, 2026
33d8a7c
fixes to compare changes functions; more content for test update work…
RossanaTat Feb 23, 2026
513d204
update simulate file changes, test for workflow, docs
RossanaTat Feb 24, 2026
d2dd7eb
reorganize files, new dev folder for internal scripts, rm old test file
RossanaTat Feb 24, 2026
fcedbac
new docs in dev folder for diagnostics and release checklist
RossanaTat Feb 24, 2026
6aaa787
write project notes file in dev/
RossanaTat Feb 26, 2026
b644875
improve and fix dev files 1 to 5
RossanaTat Feb 27, 2026
a7467cd
fixes plus readme
RossanaTat Feb 27, 2026
284bdec
fix reading of all measures in update aux data
RossanaTat Feb 27, 2026
59cd779
fixing aux missing data formattingops
RossanaTat Feb 27, 2026
853479d
add start msg and error gh msg in logs from aux fun
RossanaTat Feb 27, 2026
44fff9f
NEW TESTS ALL -RM ALL OLD FILES
RossanaTat Feb 27, 2026
9b63e98
add test utils
RossanaTat Feb 27, 2026
54fabd1
new tests -all passing
RossanaTat Feb 27, 2026
dc5b37b
fix description
RossanaTat Feb 27, 2026
8a2d495
improvementes to dev files for diagnostics
RossanaTat Mar 2, 2026
c63a9a8
new vingettes
RossanaTat Mar 2, 2026
6b7bdcd
fix in vignette
RossanaTat Mar 2, 2026
3088ccb
fix some error
RossanaTat Mar 3, 2026
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ renv/
/sessionInfoLog
.DS_Store
docs

/.quarto/
inst/doc
Empty file added .stamp/catalog.lock.lock
Empty file.
Binary file added .stamp/catalog.qs2
Binary file not shown.
11 changes: 5 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@ Suggests:
rmarkdown,
covr,
dm,
config,
myrror
myrror,
gh,
httr,
wbstats
Imports:
stamp,
haven,
digest,
fst,
readr,
data.table,
wbstats,
purrr,
fs,
magrittr,
Expand All @@ -49,15 +51,12 @@ Imports:
yaml,
qs,
glue,
gh,
httr,
pipfun (>= 0.0.2),
lifecycle,
collapse,
joyn,
data.validator,
assertr,
blastula,
rlang
VignetteBuilder: knitr
Remotes:
Expand Down
17 changes: 7 additions & 10 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
# Generated by roxygen2: do not edit by hand

export("%>%")
export(auto_aux_update)
export(aux_censoring)
export(aux_countries)
export(aux_country_list)
export(aux_cp)
export(aux_cpi)
export(aux_data)
export(aux_dictionary)
export(aux_fun)
export(aux_gdm)
export(aux_gdp)
export(aux_gdp_weo)
export(aux_income_groups)
export(aux_indicators)
export(aux_maddison)
Expand All @@ -29,10 +26,8 @@ export(aux_pl)
export(aux_pl_clean)
export(aux_pop)
export(aux_ppp)
export(aux_prices)
export(aux_regions)
export(aux_sna)
export(aux_update_all)
export(aux_wdi)
export(aux_wdi_update)
export(aux_weo)
Expand All @@ -42,7 +37,6 @@ export(clean_validation_report)
export(compare_aux_releases)
export(compare_aux_vintages)
export(compare_vintage_versions)
export(convert_df_to_base64)
export(countries_validate_output)
export(cpi_validate_output)
export(cpi_validate_raw)
Expand All @@ -52,7 +46,6 @@ export(gdm_validate_raw)
export(gdp_validate_output)
export(get_error_validation)
export(incgroup_validate_output)
export(load_aux)
export(merger_aux)
export(metadata_validate_output)
export(metadata_validate_raw)
Expand All @@ -62,6 +55,10 @@ export(npl_validate_raw)
export(pce_validate_output)
export(pfw_validate_output)
export(pfw_validate_raw)
export(pipaux_get_versioning)
export(pipaux_reset_stamp_options)
export(pipaux_set_stamp_option)
export(pipaux_set_versioning)
export(pl_validate_output)
export(pop_validate_output)
export(pop_validate_raw)
Expand All @@ -73,12 +70,10 @@ export(send_report)
export(sna_fy_validate_raw)
export(sna_validate_raw)
export(spop_validate_raw)
export(update_all_aux)
export(update_aux)
export(update_aux_measures)
export(wdi_validate_raw)
export(weo_validate_output)
export(weo_validate_raw)
import(blastula)
import(collapse, except = fdroplevels)
import(data.table)
import(data.table, except = fdroplevels)
Expand All @@ -91,3 +86,5 @@ importFrom(lifecycle,deprecated)
importFrom(magrittr,"%<>%")
importFrom(magrittr,"%>%")
importFrom(pipfun,pip_create_globals)
importFrom(stamp,st_opts)
importFrom(stamp,st_opts_get)
44 changes: 17 additions & 27 deletions R/aux_censoring.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@
#' If `action = "load"`, the function reads the previously saved local version of the
#' censoring data and returns it as a list of data.tables.
#'
#'
#' @inheritParams aux_pfw
#' @inheritParams pipfun::load_from_gh
#' @param ... Additional arguments passed to [pip_aux_save()] when `action = "update"`.
#' @export
aux_censoring <- function(action = c("update", "load"),
force = FALSE,
owner = getOption("pipfun.ghowner"),
maindir = getOption("pipaux.working_dir"),
tag = NULL) {
tag = NULL,
...) {

measure <- "censoring"
action <- match.arg(action)

pipfun::get_wrk_release(verbose = FALSE)
wrk_release <- get_from_auxenv(key = "wrk_release")

release <- wrk_release$release
identity <- wrk_release$identity
Expand Down Expand Up @@ -58,35 +57,26 @@ aux_censoring <- function(action = c("update", "load"),
if (branch == "main") {
branch <- ""
}
# ----- function raw sha ----------------------

raw_sha_fun <- digest::digest(body(
paste0("aux_", measure))
# Define key columns for censoring data
key_cols <- c("countries", "regions")
setattr(dl, "aux_key", key_cols)

saved <- pip_aux_save(
x = dl,
id = measure,
code = aux_censoring,
code_label = "aux_censoring",
#pk = key_cols, rm this because of dl being list
...
)


setattr(dl,
"raw_sha_fun",
raw_sha_fun)

msrdir <- fs::path(maindir, "aux_data", branch, measure) # measure dir

saved <- pipfun::pip_sign_save(
x = dl,
measure = measure,
msrdir = msrdir,
force = force,
verbose = FALSE
)
return(invisible(saved))

} else {

dt <- load_aux(
maindir = maindir,
measure = measure,
branch = branch
)
dt <- pipload::load_aux_data(measure = measure)

return(dt)

}
Expand Down
58 changes: 23 additions & 35 deletions R/aux_countries.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
#' @inheritParams pipfun::load_from_gh
#' @export
aux_countries <- function(action = c("update", "load"),
force = FALSE,
owner = getOption("pipfun.ghowner"),
maindir = getOption("pipaux.working_dir"),
tag = NULL) {
tag = NULL,
...) {

measure <- "countries"
action <- match.arg(action)
action <- match.arg(action)

pipfun::get_wrk_release(verbose = FALSE)
wrk_release <- get_from_auxenv(key = "wrk_release")

release <- wrk_release$release
identity <- wrk_release$identity
Expand All @@ -27,13 +26,9 @@ aux_countries <- function(action = c("update", "load"),
if (action == "update") {

## Special national accounts --------
cl <- load_aux(maindir = maindir,
measure = "country_list",
branch = branch)
cl <- pipload::load_aux_data(measure = "country_list")

pfw <- load_aux(measure = "pfw",
maindir = maindir,
branch = branch)
pfw <- pipload::load_aux_data(measure = "pfw")


pfw <- pfw[inpovcal == 1,
Expand All @@ -44,42 +39,35 @@ aux_countries <- function(action = c("update", "load"),


countries <- cl[country_code %in% pfw$country_code
][,
c("pcn_region", "pcn_region_code") := NULL]
# ][,
# c("pcn_region", "pcn_region_code") := NULL]
]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## save --------

if (branch == "main") {
branch <- ""
}
msrdir <- fs::path(maindir, "aux_data", branch, measure) # measure dir

setattr(countries, "aux_name", "countries")
setattr(countries,
"aux_key",
c("country_code"))

# ----- function raw sha ------
raw_sha_fun <- digest::digest(body(
paste0("aux_", measure))
setattr(countries, "aux_name", "countries")
key_cols <- c("country_code")
setattr(countries, "aux_key", key_cols)

pip_aux_save(
x = countries,
id = measure,
pk = key_cols,
code = aux_countries,
code_label = "aux_countries",
...
)

setattr(countries,
"raw_sha_fun",
raw_sha_fun)

pipfun::pip_sign_save(
x = countries,
measure = measure,
msrdir = msrdir,
force = force
)
} else {
df <- load_aux(
maindir = maindir,
measure = measure
)

df <- pipload::load_aux_data(measure = measure)

return(df)
}
}
Expand Down
Loading
Loading