Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
bfa8390
feat: initial support for names(teal_data)
averissimo Oct 28, 2024
127bc7c
docs: update NEWS
averissimo Oct 28, 2024
cb2cc57
docs: minor change
averissimo Oct 28, 2024
72f0595
fix: warning in R CMD check
averissimo Oct 28, 2024
9a6343a
docs: typo
averissimo Oct 28, 2024
e1a69b3
fix: remove implementation of names()<- as error message is self
averissimo Oct 28, 2024
c335f52
fix: remove extra arguments for names, not supported
averissimo Oct 28, 2024
873a1b6
fix: remove extra word from wordlist
averissimo Oct 28, 2024
a203f81
feat: `qenv` inherits from environment class
averissimo Oct 29, 2024
fd93704
Merge branch 'main' into 333_deprecate_datanames@main
averissimo Oct 29, 2024
8b855f3
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
dependabot-preview[bot] Oct 29, 2024
4efca24
fix: improves tests and adds $ getter to qenv.error with similar beha…
averissimo Oct 29, 2024
0a02726
feat: prevent assignment to qenv.error
averissimo Oct 29, 2024
281c994
doc: update news
averissimo Oct 29, 2024
b1ffbe7
fix: problem when printing qenv.error
averissimo Oct 29, 2024
e457a4c
docs: adds .xData slot documentation
averissimo Oct 29, 2024
2c76a8a
chore: cleanup of previous implementation of names.qenv
averissimo Oct 29, 2024
ab9e342
chore: lintr cleanup
averissimo Oct 29, 2024
c56a5ca
feat: expand on compatibility with an environment
averissimo Oct 30, 2024
9904570
fix: complete tests for qenv-class
averissimo Oct 30, 2024
5c0ef7d
doc: adds section to qenv constructor
averissimo Oct 30, 2024
558bd72
fix: test and adds extra protection on qenv validation
averissimo Oct 30, 2024
4ec3e9f
fix: move constructor logic to "initialize" method of qenv
averissimo Oct 30, 2024
e00fd92
fix: problem with integer (1L) shorthand in within
averissimo Oct 30, 2024
be480f1
test: problem with integer (1L) shorthand in within
averissimo Oct 30, 2024
b7d1885
fix: order and formal of callNextMethod
averissimo Oct 30, 2024
2a32022
fix: minor bugs
averissimo Oct 30, 2024
9049379
chore: fix lintr
averissimo Oct 30, 2024
bb5c5fb
Apply suggestions from code review
averissimo Oct 31, 2024
709265f
docs: update
averissimo Oct 31, 2024
1fe8b18
docs: small improvements
averissimo Oct 31, 2024
3ae0541
[skip style] [skip vbump] Restyle files
github-actions[bot] Oct 31, 2024
0a64498
Update tests/testthat/test-qenv_within.R
averissimo Oct 31, 2024
d4ee6d0
docs: implements @gogonzo suggestions and cleans up docs
averissimo Oct 31, 2024
af7054b
docs: move section around
averissimo Oct 31, 2024
c668d98
docs: superseded
averissimo Oct 31, 2024
faa843b
fix: use newlines in code parseing on multiline expression with within
averissimo Nov 1, 2024
2f553eb
Merge branch 'main' into 333_deprecate_datanames@main
averissimo Nov 4, 2024
015f11c
fix: problems with check
averissimo Nov 4, 2024
7cd8949
chore: rename instances of ls to names
averissimo Nov 5, 2024
50be4b0
chore: rename instances of join to c
averissimo Nov 5, 2024
9d2ec00
docs: improvement on join() documentation
averissimo Nov 5, 2024
c76e148
Apply suggestions from code review
averissimo Nov 5, 2024
620849b
pr: apply suggestions
averissimo Nov 5, 2024
1e25681
pr: apply suggestions (remove duplicate test)
averissimo Nov 5, 2024
7b7ae6a
Update R/qenv-join.R
averissimo Nov 5, 2024
7ea19e3
fix: error with suggestion
averissimo Nov 5, 2024
bf5ed47
fix: tests
averissimo Nov 5, 2024
903a43c
feat: qenv constructor improvement
averissimo Nov 6, 2024
f9fef18
Update tests/testthat/test-qenv-class.R
averissimo Nov 7, 2024
3bd3ff5
[skip style] [skip vbump] Restyle files
github-actions[bot] Nov 7, 2024
d8d1a8e
chore: trigger CI
averissimo Nov 7, 2024
236ce59
Update README.md
averissimo Nov 7, 2024
4564f34
Update R/qenv-get_env.R
averissimo Nov 7, 2024
9f76e48
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
dependabot-preview[bot] Nov 7, 2024
49e49c9
fix: remove unnecessary listing
averissimo Nov 7, 2024
1f4b755
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
dependabot-preview[bot] Nov 7, 2024
a5fcb9a
chore: trigger CI
averissimo Nov 7, 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
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Collate:
'qenv-get_var.R'
'qenv-get_warnings.R'
'qenv-join.R'
'qenv-names.R'
'qenv-show.R'
'qenv-within.R'
'teal.code-package.R'
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Generated by roxygen2: do not edit by hand

S3method("[[",qenv.error)
S3method(names,qenv)
S3method(names,qenv.error)
S3method(within,qenv)
S3method(within,qenv.error)
export(concat)
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* `get_code()` was extended with `names` parameter and allows the code extraction to be limited to objects stored in
`qenv` but limited to `names`.
* Added `names()` function for `qenv` objects, which dynamically determines the visible objects in the environment.

# teal.code 0.5.0

Expand Down
1 change: 0 additions & 1 deletion R/qenv-eval_code.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ setMethod("eval_code", signature = c("qenv", "character"), function(object, code
}
}


object@warnings <- c(object@warnings, current_warnings)
object@messages <- c(object@messages, current_messages)

Expand Down
33 changes: 33 additions & 0 deletions R/qenv-names.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#' The Names of a `qenv` or `qenv_error` Object
#'
#' Functions to get the names of a `qenv` or `qenv_error` object.
#' The names are extrapolated from the objects in the `qenv` environment and
#' are not stored statically, unlike the normal behavior of `names()` function.
#'
#' Objects named with a `.` (dot) prefix will be ignored and not returned.
#'
#' @param x (`qenv` or `qenv_error`) object.
#' @return A character vector of names.
#'
#' @seealso [base::names()]
#'
#' @examples
#' q1 <- within(qenv(), iris <- iris)
#' names(q1)
#'
#' q2 <- within(q1, {
#' mtcars <- mtcars
#' CO2 <- CO2
#' })
#' names(q2)
#'
#' @export
names.qenv <- function(x) {
ls(get_env(x))
}

#' @rdname names.qenv
#' @export
names.qenv.error <- function(x) {
NULL
}
1 change: 1 addition & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ reference:
- get_var
- get_warnings
- join
- names.qenv
- new_qenv
- qenv
- show,qenv-method
Expand Down
4 changes: 2 additions & 2 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Forkers
Hoffmann
Reproducibility
funder
Hoffmann
qenv
repo
Reproducibility
reproducibility
39 changes: 39 additions & 0 deletions man/names.qenv.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-qenv_get_code.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ testthat::test_that("extracts the code without downstream usage", {
)
})

testthat::test_that("works for datanames of length > 1", {
testthat::test_that("works for names of length > 1", {
code <- c(
"a <- 1",
"b <- 2"
Expand Down
Loading