Skip to content
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

Release 0.4.0 #203

Merged
merged 66 commits into from
Nov 4, 2021
Merged
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
64a5a0a
Add initial cheatsheet
Jul 20, 2021
d3f6584
Initial addition of validation packets vignette and code
Jul 21, 2021
1d81e19
argument corrections and cleaning up the external resources vignette
Jul 21, 2021
3ab4a7a
Add valtools hex to package. Thanks @MayaGans
Aug 5, 2021
30b67b9
Add cheatsheets to .Rbuildignore & to readme
Aug 5, 2021
d5a70da
convert cheatsheet pdf to png, update readme to reflect that
Aug 6, 2021
5092f7e
some wording and spacing updates to the packet vignette
Aug 6, 2021
c163714
Add a packet template - similar to standard but removes the expectati…
Aug 6, 2021
0b58993
improve config test coverage
Aug 6, 2021
bcf68ca
correct packet creation function & test cleanup
Aug 6, 2021
e9f39c3
set covr nocov
Aug 9, 2021
e459695
Move cheatsheets to man/figures
thebioengineer Aug 10, 2021
ced5d77
update .Rbuildignore cheatsheet paths
thebioengineer Aug 10, 2021
0aca7db
Merge pull request #180 from phuse-org/add_cheatsheet_flow
Aug 10, 2021
b61a4ef
Add to roxygen_copy tests
Aug 11, 2021
8bb4dd5
example of figure comparisons
Aug 13, 2021
6adc9ff
spelling and make reference to location saved within validation infra
Aug 13, 2021
a959267
Update tests and remove cases where coverage tag has no ":" as allowable
Aug 19, 2021
44b0d96
Add missed space and closing parenthesis for test
Aug 19, 2021
0a47f42
Merge pull request #181 from phuse-org/validation_packet
Aug 19, 2021
8df1104
Merge pull request #188 from phuse-org/malformed_coverage_tags
Aug 19, 2021
8eeb9bf
Merge branch 'develop' into test_coverage_improvements
Aug 20, 2021
eb601e2
remove extra space, affects sorting
mariev Aug 20, 2021
376132e
ordering at export
mariev Aug 20, 2021
f0c9269
update tests
mariev Aug 21, 2021
7076710
remove dplyr dependency in tests
mariev Aug 21, 2021
b83e3bd
lingering dplyr
mariev Aug 21, 2021
ac3a4e8
Merge pull request #189 from phuse-org/hotfix-coverage-matrix
mariev Aug 23, 2021
225a389
develop should be ahead of main
mariev Aug 26, 2021
0c56533
Merge pull request #192 from phuse-org/hotfix-versioning
mariev Aug 27, 2021
6cd61fd
update to return file path if file already exists.
thebioengineer Sep 5, 2021
1d22d5d
move adding file to config only if file didnt exist before
thebioengineer Sep 5, 2021
cb5cae0
Update dynamic referencing to handle NA entries in data.frames
thebioengineer Sep 5, 2021
6b1058f
Use grepl rather than exact matching in template so user could have m…
thebioengineer Sep 5, 2021
094a78a
Apply suggestions from code review
Sep 5, 2021
44cdbc7
Clean up file comparison vignette
thebioengineer Sep 8, 2021
3339e9a
add p2 of cheatsheet
mariev Sep 17, 2021
c183014
Merge pull request #195 from phuse-org/vt_file_overwriting
Sep 17, 2021
e051ae8
Merge pull request #196 from phuse-org/dynamic_ref_na_fix
thebioengineer Sep 17, 2021
633f6a5
Merge pull request #197 from phuse-org/cleaner_validation_lead_template
thebioengineer Sep 17, 2021
7109417
add cheatsheet links to readme
mariev Sep 19, 2021
e6090e0
Merge pull request #199 from phuse-org/cheatsheet-p2
mariev Sep 20, 2021
8fdab52
Update vignettes/validation_figure_tests.Rmd
thebioengineer Oct 2, 2021
2010e46
Update vignettes/validation_figure_tests.Rmd
thebioengineer Oct 2, 2021
5921905
Merge pull request #185 from phuse-org/testing_figure_comparisons
thebioengineer Oct 7, 2021
22cefec
citation added
mariev Oct 14, 2021
9077203
eol
mariev Oct 14, 2021
ae2c987
fix versioning
mariev Oct 14, 2021
c19f136
Merge pull request #182 from phuse-org/test_coverage_improvements
thebioengineer Oct 14, 2021
1351a09
Merge pull request #201 from phuse-org/citation
mariev Oct 14, 2021
6abb8df
Merge Develop version 0.4.0 into Main
thebioengineer Oct 18, 2021
7d2585a
Update extension checker to allow for Rmd
thebioengineer Oct 19, 2021
eb9ea95
Set skip params if pandoc was not 2.7.3
thebioengineer Oct 19, 2021
8ff6d60
Add interactive previewing of vt_file
thebioengineer Oct 19, 2021
800d96e
Added tests for multiple extension options
thebioengineer Oct 19, 2021
6f468c5
Allow interactive printing of md and Rmd files
thebioengineer Oct 19, 2021
98fa8c5
Merge pull request #206 from phuse-org/extend_file_extensions
thebioengineer Oct 20, 2021
069f946
Merge pull request #207 from phuse-org/vt_file_interactive_knitting
thebioengineer Oct 28, 2021
7e4f250
Merge branch 'develop' into release_0.4.0
thebioengineer Oct 28, 2021
bffffab
Giving informative error message when root cannot be found
thebioengineer Oct 28, 2021
34df0b0
Correct sentence structure
thebioengineer Oct 28, 2021
7a56d39
NOrmalize paths for error messages?
thebioengineer Oct 28, 2021
8cb4b0c
Merge pull request #210 from phuse-org/out_of_project_warnings
thebioengineer Nov 2, 2021
5282766
Merge branch 'develop' into release_0.4.0
thebioengineer Nov 2, 2021
00e4f7c
Add Maya as a contributor (resolves #211)
thebioengineer Nov 4, 2021
a28a050
Merge branch 'develop' into release_0.4.0
thebioengineer Nov 4, 2021
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
Prev Previous commit
Next Next commit
Add interactive previewing of vt_file
thebioengineer committed Oct 19, 2021
commit 8ff6d60cfb72114fe62a0b61c3b661b87daa8bb1
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.1
RoxygenNote: 7.1.2
Suggests:
covr,
XML,
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -88,6 +88,7 @@ importFrom(kableExtra,kable_styling)
importFrom(knitr,asis_output)
importFrom(knitr,current_input)
importFrom(knitr,kable)
importFrom(knitr,knit)
importFrom(knitr,knit_child)
importFrom(knitr,opts_knit)
importFrom(lubridate,parse_date_time)
40 changes: 30 additions & 10 deletions R/vt_file.R
Original file line number Diff line number Diff line change
@@ -80,7 +80,7 @@ file_parse.default <- function(file, ..., dynamic_referencing = FALSE){

#' @importFrom knitr knit_child
#' @importFrom withr with_options
file_parse.md <- function(file, ..., reference = NULL, envir = parent.frame(), dynamic_referencing = FALSE){
file_parse.md <- function(file, ..., reference = NULL, envir = parent.frame(), interactive_output = interactive(), dynamic_referencing = FALSE){

if(dynamic_referencing){
text <- dynamic_reference_rendering(file, reference = reference)
@@ -91,6 +91,28 @@ file_parse.md <- function(file, ..., reference = NULL, envir = parent.frame(), d
## remove roxygen comments
text <- text[!grepl("^#'", text)]

if(interactive_output){
file_parse.md.interactive(text, ..., envir = envir)
}else{
file_parse.md.knitting(text, ..., envir = envir)
}

}

#' @importFrom knitr knit
file_parse.md.interactive <- function(text, ..., envir = parent.frame()){
with_options(new = list(knitr.duplicate.label = "allow"), {
cat(asis_output(knit(
text = text,
envir = envir,
...,
quiet = TRUE
)))
})
}

#' @importFrom knitr knit_child
file_parse.md.knitting <- function(text, ..., envir = parent.frame()){
with_options(new = list(knitr.duplicate.label = "allow"), {
cat(asis_output(knit_child(
text = text,
@@ -101,11 +123,12 @@ file_parse.md <- function(file, ..., reference = NULL, envir = parent.frame(), d
})
}


file_parse.rmd <- file_parse.md



file_parse.r_test_code <- function(file, ..., reference = NULL, envir = parent.frame(), dynamic_referencing = FALSE){
file_parse.r_test_code <- function(file, ..., reference = NULL, envir = parent.frame(), interactive_output = interactive(), dynamic_referencing = FALSE){

text <- c("```{r echo = FALSE}",
paste0("results <- eval_test_code(path = ",bquote(file),")"),
@@ -116,14 +139,11 @@ file_parse.r_test_code <- function(file, ..., reference = NULL, envir = parent.f

text <- text[!is.na(text)]

with_options(new = list(knitr.duplicate.label = "allow"), {
cat(asis_output(knit_child(
text = text,
envir = envir,
...,
quiet = TRUE
)))
})
if(interactive_output){
file_parse.md.interactive(text, ..., envir = envir)
}else{
file_parse.md.knitting(text, ..., envir = envir)
}
}

#' output to render kable to
21 changes: 15 additions & 6 deletions tests/testthat/test-vt_file.R
Original file line number Diff line number Diff line change
@@ -28,45 +28,48 @@ test_that("evaluting markdown files works", {
referencer <- vt_dynamic_referencer$new()

sample_output <- capture.output({
cat(file_parse.md(file = "sample.md"))
cat(file_parse.md(file = "sample.md", interactive_output = TRUE))
})

sample_output2 <- capture.output({
cat(file_parse.md(
file = "sample2.md",
reference = referencer,
interactive_output = TRUE,
dynamic_referencing = TRUE))
})


sample_output3 <- capture.output({
vt_file(file = "sample.md")
vt_file(file = "sample.md", interactive_output = TRUE)
})

sample_output4 <- capture.output({
vt_file(
file = "sample2.md",
reference = referencer,
interactive_output = TRUE,
dynamic_referencing = TRUE)
})

expect_equal(
sample_output,
c("","## Header", "+ Content", " + more content", "+ Content 2")
c("## Header", "+ Content", " + more content", "+ Content 2")
)

expect_equal(
sample_output2,
c("","## Header", "+ 1.1 Reference", " + more content", "+ Content 2")
c("## Header", "+ 1.1 Reference", " + more content", "+ Content 2")
)

expect_equal(
sample_output3,
c("","## Header", "+ Content", " + more content", "+ Content 2")
c("## Header", "+ Content", " + more content", "+ Content 2")
)

expect_equal(
sample_output4,
c("","## Header", "+ 1.1 Reference", " + more content", "+ Content 2")
c("## Header", "+ 1.1 Reference", " + more content", "+ Content 2")
)

})
@@ -115,30 +118,36 @@ test_that("evaluating Rmarkdown files works", {
sample_output <- capture.output({
file_parse.rmd(
file = "sample.Rmd",
interactive_output = FALSE,
envir = curr_env)
})

sample_output2 <- capture.output({
file_parse.rmd(
file = "sample2.Rmd",
reference = referencer,
interactive_output = FALSE,
dynamic_referencing = TRUE,
envir = curr_env)
})

sample_output3 <- capture.output({
vt_file(file = "sample.Rmd",
interactive_output = FALSE,
envir = curr_env)
})

sample_output4 <- capture.output({
vt_file(
file = "sample2.Rmd",
reference = referencer,
interactive_output = FALSE,
dynamic_referencing = TRUE,
envir = curr_env)
})

browser()

expect_equal(
sample_output,
c("","","",