Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: acro
Title: A Tool for Semi-Automating the Statistical Disclosure Control of Research Outputs
Version: 0.1.6
Version: 0.1.7
Authors@R: c(
person("Jim", "Smith", role = c("cre","ctb"),
email = "James.Smith@uwe.ac.uk", comment = c(ORCID = "0000-0001-7908-1859")),
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export(acro_add_comments)
export(acro_add_exception)
export(acro_crosstab)
export(acro_custom_output)
export(acro_disable_suppression)
export(acro_enable_suppression)
export(acro_finalise)
export(acro_glm)
export(acro_hist)
Expand Down
13 changes: 13 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@

# acro 0.1.7
* Added support for installation via conda
* Added support for specifying config files when acro session is started
* Added support for specifying whether suppression is on or off when acro session is started
* Added support for toggling suppression dynamically during session via `acro_enable_supression()`
and `acro_disable_suppression()`
* Improved documentation in package and at [sacro-tools.org](sacro-tools.org)
* Added Support for variable names with spaces when calling crosstab
* Set status of disclosive outputs to 'review' (previously 'fail') when suppression has been applied
* Automatically add exception message when applying suppression to an output
* Make `acro_finalise()` non-interactive by default (interactive is now option at call time)

# acro 0.1.6

* Upgrade ACRO Python backend to v0.4.11, supporting Python 3.14.
Expand Down
2 changes: 1 addition & 1 deletion R/acro_init.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Globals -----------------------------------------------------------------
acro_venv <- "r-acro"
acro_pkg <- "acro==0.4.11"
acro_pkg <- "acro==0.4.12"
ch <- "conda-forge"


Expand Down
25 changes: 25 additions & 0 deletions R/output_commands.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,28 @@ acro_finalise <- function(path, ext) {
}
acroEnv$ac$finalise(path, ext)
}


#' Turns suppression on during a session
#'
#' @return No return value, called for side effects
#' @export

acro_enable_suppression <- function() {
if (is.null(acroEnv$ac)) {
stop("ACRO has not been initialised. Please first call acro_init().")
}
acroEnv$ac$enable_suppression()
}

#' Turns suppression off during a session
#'
#' @return No return value, called for side effects
#' @export

acro_disable_suppression <- function() {
if (is.null(acroEnv$ac)) {
stop("ACRO has not been initialised. Please first call acro_init().")
}
acroEnv$ac$disable_suppression()
}
21 changes: 9 additions & 12 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -1,41 +1,38 @@
ADR
Acknowledgement
Analytics
Conda
EPSRC
GPLv
GRAIMATTER
HDR
Initialise
Karnofsky
MRC
MyBinder
NK
PyPI
RStudio
SACRO
SDC
Scalable
TRE
TREs
TREvolution
Transformative
Xplore
YAML
analytics
auditable
btn
codecov
conda
config
crosstab
disclosive
finalise
github
https
initialised
json
mitigations
numpy
openml
organisation
pre
programme
sacro
scipy
sm
statsmodels
www
xlsx
yaml
14 changes: 14 additions & 0 deletions man/acro_disable_suppression.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions man/acro_enable_suppression.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions tests/testthat/test-acro_disable_suppression.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
test_that("acro_enable_suppression without initialising ACRO object first", {
acroEnv$ac <- NULL
expect_error(acro_disable_suppression(), "ACRO has not been initialised. Please first call acro_init()")
})

test_that("acro_disable_suppression works", {
testthat::skip_on_cran()
acro_init()
foo <- acro_disable_suppression()
table <- acro_crosstab(index = nursery_data[, c("recommend")], columns = nursery_data[, c("parents")])
output <- acro_print_outputs()
status <- "fail"
expect_true(any(grepl(status, output)))
})
14 changes: 14 additions & 0 deletions tests/testthat/test-acro_enable_suppression.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
test_that("acro_enable_suppression without initialising ACRO object first", {
acroEnv$ac <- NULL
expect_error(acro_enable_suppression()(), "ACRO has not been initialised. Please first call acro_init()")
})

test_that("acro_enable_suppression works", {
testthat::skip_on_cran()
acro_init()
acro_enable_suppression()
table <- acro_crosstab(index = nursery_data[, c("recommend")], columns = nursery_data[, c("parents")])
output <- acro_print_outputs()
status <- "review"
expect_true(any(grepl(status, output)))
})
1 change: 0 additions & 1 deletion tests/testthat/test-acro_pivot_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ test_that("acro_pivot_table works", {

acro_init()
table <- acro_pivot_table(data = nursery_data, index = "parents", values = "children", aggfunc = list("mean", "std"))
print(expected_table)
expect_equal(table[, -1, drop = FALSE], expected_table[, -1, drop = FALSE])
})
2 changes: 1 addition & 1 deletion vignettes/supports.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "What ACRO-R Supports"

# What ACRO-R Supports

This page provides a comprehensive overview of ACRO’s capabilities. ACRO supports a wide range of statistical analysis functions with automated disclosure control.
This page provides a comprehensive overview of the capabilities ACRO supports. ACRO supports a wide range of statistical analysis functions with automated disclosure control.

## Supported Data Analysis Functions

Expand Down
Loading