-
-
Notifications
You must be signed in to change notification settings - Fork 8
Change qenv as environment "type" -- adds names(qenv/qenv.error), get() and $ S3 methods
#218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 13 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 127bc7c
docs: update NEWS
averissimo cb2cc57
docs: minor change
averissimo 72f0595
fix: warning in R CMD check
averissimo 9a6343a
docs: typo
averissimo e1a69b3
fix: remove implementation of names()<- as error message is self
averissimo c335f52
fix: remove extra arguments for names, not supported
averissimo 873a1b6
fix: remove extra word from wordlist
averissimo a203f81
feat: `qenv` inherits from environment class
averissimo fd93704
Merge branch 'main' into 333_deprecate_datanames@main
averissimo 8b855f3
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
dependabot-preview[bot] 4efca24
fix: improves tests and adds $ getter to qenv.error with similar beha…
averissimo 0a02726
feat: prevent assignment to qenv.error
averissimo 281c994
doc: update news
averissimo b1ffbe7
fix: problem when printing qenv.error
averissimo e457a4c
docs: adds .xData slot documentation
averissimo 2c76a8a
chore: cleanup of previous implementation of names.qenv
averissimo ab9e342
chore: lintr cleanup
averissimo c56a5ca
feat: expand on compatibility with an environment
averissimo 9904570
fix: complete tests for qenv-class
averissimo 5c0ef7d
doc: adds section to qenv constructor
averissimo 558bd72
fix: test and adds extra protection on qenv validation
averissimo 4ec3e9f
fix: move constructor logic to "initialize" method of qenv
averissimo e00fd92
fix: problem with integer (1L) shorthand in within
averissimo be480f1
test: problem with integer (1L) shorthand in within
averissimo b7d1885
fix: order and formal of callNextMethod
averissimo 2a32022
fix: minor bugs
averissimo 9049379
chore: fix lintr
averissimo bb5c5fb
Apply suggestions from code review
averissimo 709265f
docs: update
averissimo 1fe8b18
docs: small improvements
averissimo 3ae0541
[skip style] [skip vbump] Restyle files
github-actions[bot] 0a64498
Update tests/testthat/test-qenv_within.R
averissimo d4ee6d0
docs: implements @gogonzo suggestions and cleans up docs
averissimo af7054b
docs: move section around
averissimo c668d98
docs: superseded
averissimo faa843b
fix: use newlines in code parseing on multiline expression with within
averissimo 2f553eb
Merge branch 'main' into 333_deprecate_datanames@main
averissimo 015f11c
fix: problems with check
averissimo 7cd8949
chore: rename instances of ls to names
averissimo 50be4b0
chore: rename instances of join to c
averissimo 9d2ec00
docs: improvement on join() documentation
averissimo c76e148
Apply suggestions from code review
averissimo 620849b
pr: apply suggestions
averissimo 1e25681
pr: apply suggestions (remove duplicate test)
averissimo 7b7ae6a
Update R/qenv-join.R
averissimo 7ea19e3
fix: error with suggestion
averissimo bf5ed47
fix: tests
averissimo 903a43c
feat: qenv constructor improvement
averissimo f9fef18
Update tests/testthat/test-qenv-class.R
averissimo 3bd3ff5
[skip style] [skip vbump] Restyle files
github-actions[bot] d8d1a8e
chore: trigger CI
averissimo 236ce59
Update README.md
averissimo 4564f34
Update R/qenv-get_env.R
averissimo 9f76e48
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
dependabot-preview[bot] 49e49c9
fix: remove unnecessary listing
averissimo 1f4b755
[skip roxygen] [skip vbump] Roxygen Man Pages Auto Update
dependabot-preview[bot] a5fcb9a
chore: trigger CI
averissimo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,7 @@ reference: | |
| - get_var | ||
| - get_warnings | ||
| - join | ||
| - names.qenv | ||
| - new_qenv | ||
| - qenv | ||
| - show,qenv-method | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| Forkers | ||
| Hoffmann | ||
| Reproducibility | ||
| funder | ||
| Hoffmann | ||
| qenv | ||
| repo | ||
| Reproducibility | ||
| reproducibility |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,67 @@ | ||
| testthat::describe("qenv inherits from environment: ", { | ||
gogonzo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| testthat::it("is an environment", { | ||
| testthat::expect_true(is.environment(qenv())) | ||
| }) | ||
|
|
||
| testthat::it("ls() shows nothing on empty environment", { | ||
| testthat::expect_identical(ls(qenv(), all.names = TRUE), character(0)) | ||
| }) | ||
|
|
||
| testthat::it("ls() shows available objets", { | ||
| q <- within(qenv(), iris <- iris) | ||
| testthat::expect_setequal(ls(q), "iris") | ||
| }) | ||
|
|
||
| testthat::it("ls() does not show hidden objects", { | ||
| q <- within(qenv(), { | ||
| iris <- iris | ||
| .hidden <- 2 | ||
| }) | ||
| testthat::expect_setequal(ls(q), "iris") | ||
| }) | ||
|
|
||
| testthat::it("names() show all objects", { | ||
| q <- eval_code(qenv(), " | ||
| iris <- iris | ||
| .hidden <- 2 | ||
| ") | ||
| testthat::expect_setequal(names(q), c("iris", ".hidden")) | ||
| }) | ||
|
|
||
| testthat::it("does not allow binding to be added", { | ||
| q <- qenv() | ||
| testthat::expect_error(q$x <- 1, "cannot add bindings to a locked environment") | ||
| }) | ||
|
|
||
| testthat::it("does not allow binding to be modified", { | ||
| q <- within(qenv(), obj <- 1) | ||
| testthat::expect_error(q$obj <- 2, "cannot change value of locked binding for 'obj'") | ||
| }) | ||
| }) | ||
|
|
||
| testthat::test_that("constructor returns qenv", { | ||
| q <- qenv() | ||
| testthat::expect_s4_class(q, "qenv") | ||
| testthat::expect_identical(ls(q@env), character(0)) | ||
| testthat::expect_identical(ls(q@.xData, all.names = TRUE), character(0)) | ||
| testthat::expect_identical(q@code, character(0)) | ||
| testthat::expect_identical(q@id, integer(0)) | ||
| testthat::expect_identical(q@warnings, character(0)) | ||
| testthat::expect_identical(q@messages, character(0)) | ||
| }) | ||
|
|
||
| testthat::test_that("parent of qenv environment is the parent of .GlobalEnv", { | ||
| q <- qenv() | ||
| testthat::expect_identical(parent.env(q@env), parent.env(.GlobalEnv)) | ||
| testthat::describe("parent of qenv environment is the parent of .GlobalEnv", { | ||
| testthat::it("via slot", { | ||
| q <- qenv() | ||
| testthat::expect_identical(parent.env(q@.xData), parent.env(.GlobalEnv)) | ||
| }) | ||
|
|
||
| testthat::it("via qenv directly", { | ||
| q <- qenv() | ||
| testthat::expect_identical(parent.env(q), parent.env(.GlobalEnv)) | ||
| }) | ||
| }) | ||
|
|
||
| testthat::test_that("parent of qenv environment is locked", { | ||
| testthat::test_that("qenv environment is locked", { | ||
| q <- qenv() | ||
| testthat::expect_error(q@env$x <- 1, "cannot add bindings to a locked environment") | ||
| testthat::expect_error(q@.xData$x <- 1, "cannot add bindings to a locked environment") | ||
| }) | ||
averissimo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.