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

datanames in vignettes #239

Merged
merged 22 commits into from
Jan 7, 2025
Merged

datanames in vignettes #239

merged 22 commits into from
Jan 7, 2025

Conversation

gogonzo
Copy link
Contributor

@gogonzo gogonzo commented Dec 18, 2024

Refers to #338

  • Modified a documentation a little bit to emphasize inheritance from environment.
  • @averissimo I'm thinking to move description of eval_code, within, get_code away from details of qenv to a new section "Interacting with qenv".
  • I'm thinking also to use a term "qenv environment" instead of "qenv object" to emphasize it is an environment.

@gogonzo gogonzo added the core label Dec 18, 2024
@gogonzo gogonzo changed the title 338 datanames in vignettes datanames in vignettes Dec 18, 2024
Copy link
Contributor

@averissimo averissimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • @averissimo I'm thinking to move description of eval_code, within, get_code away from details of qenv to a new section "Interacting with qenv".

Keeping it in @details makes it consistent with other R documentation and our own.

But I'm not opposed to this change if it improves the readability

R/qenv-eval_code.R Outdated Show resolved Hide resolved
R/qenv-constructor.R Outdated Show resolved Hide resolved
@gogonzo
Copy link
Contributor Author

gogonzo commented Dec 18, 2024

Keeping it in @details makes it consistent with other R documentation and our own.
But I'm not opposed to this change if it improves the readability

Yup, I think it is fine now. It was my first thought with the @details but right now sections looks better.

@gogonzo gogonzo marked this pull request as ready for review December 18, 2024 21:37
Copy link
Contributor

github-actions bot commented Dec 18, 2024

badge

Code Coverage Summary

Filename                         Stmts    Miss  Cover    Missing
-----------------------------  -------  ------  -------  ---------
R/qenv-c.R                          55       0  100.00%
R/qenv-class.R                      12       0  100.00%
R/qenv-concat.R                      7       0  100.00%
R/qenv-constructor.R                 1       0  100.00%
R/qenv-errors.R                      4       4  0.00%    6-9
R/qenv-eval_code.R                  57       2  96.49%   106, 115
R/qenv-extract.R                    30       0  100.00%
R/qenv-get_code.R                   24       0  100.00%
R/qenv-get_env.R                     3       1  66.67%   27
R/qenv-get_messages.r                5       0  100.00%
R/qenv-get_var.R                    26       0  100.00%
R/qenv-get_warnings.R                5       0  100.00%
R/qenv-join.R                        7       7  0.00%    137-151
R/qenv-length.R                      2       1  50.00%   2
R/qenv-show.R                       29      29  0.00%    19-50
R/qenv-within.R                      8       0  100.00%
R/utils-get_code_dependency.R      200       2  99.00%   160, 258
R/utils.R                           30       0  100.00%
TOTAL                              505      46  90.89%

Diff against main

Filename         Stmts    Miss  Cover
-------------  -------  ------  --------
R/qenv-show.R      +28     +28  +100.00%
TOTAL              +28     +28  -5.34%

Results for commit: a44e53c

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Copy link
Contributor

github-actions bot commented Dec 18, 2024

Unit Tests Summary

  1 files   12 suites   3s ⏱️
151 tests 146 ✅ 5 💤 0 ❌
230 runs  225 ✅ 5 💤 0 ❌

Results for commit a44e53c.

♻️ This comment has been updated with latest results.

@gogonzo gogonzo requested a review from averissimo December 19, 2024 13:02
Copy link
Contributor

@averissimo averissimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! I've added a few comments

R/qenv-eval_code.R Outdated Show resolved Hide resolved
R/qenv-get_code.R Outdated Show resolved Hide resolved
R/qenv-within.R Outdated Show resolved Hide resolved
R/qenv-within.R Outdated Show resolved Hide resolved
R/qenv-eval_code.R Outdated Show resolved Hide resolved
R/qenv-within.R Outdated Show resolved Hide resolved
Co-authored-by: André Veríssimo <[email protected]>
Signed-off-by: Dawid Kałędkowski <[email protected]>
R/qenv-show.R Outdated Show resolved Hide resolved
Copy link
Contributor

@averissimo averissimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job with the custom print method, the grayed out names is a brilliant touch

I think it works great with most cases I can think of. It doesn't show the right class with rlang::missing_arg(), but that is a very special case

pkgload::load_all("teal.code", export_all = TRUE)
weird_classes <- qenv() |> 
  within({
    a <- 2
    b <- 5 + 1i
    c <- 10L
    .d_e <- new.env()
    data("miniACC", package = "MultiAssayExperiment", envir = .d_e)
    .d <- .d_e$miniACC
    e <- structure(list(1), class = c("yada", "bla"))
    .f <- iris
    ` a very !weird name` <- R6::R6Class("A", public = list(a = 1))
    an_r6_instance <- R6::R6Class("A Class", public = list(a = 1))$new()
    g <- structure(list(1), class = "override")
    class(g) <- 2
    h <- function(x) 1234
    x <- rlang::missing_arg()
    y <- quote(foo)
    z <- expression(1+1)
  })
weird_classes
#> <environment: 0x6132e7c2c728> [L]
#> Parent: <environment: package:MultiAssayExperiment> 
#> - ` a very !weird name`: [R6ClassGenerator]
#> - a: [numeric]
#> - an_r6_instance: [A Class]
#> - b: [complex]
#> - c: [integer]
#> - e: [yada]
#> - g: [2]
#> - h: [function]
#> - x: [name]
#> - y: [name]
#> - z: [expression]
#> - .d: [MultiAssayExperiment]
#> - .d_e: [environment]
#> - .f: [data.frame]
rlang::env_print(as.environment(weird_classes))
#> <environment: 0x6132e7c2c728> [L]
#> Parent: <environment: package:MultiAssayExperiment>
#> Bindings:
#> • x: <missing> [L]
#> • y: <sym> [L]
#> • z: <expression> [L]
#> • a: <dbl> [L]
#> • b: <cpl> [L]
#> • c: <int> [L]
#> • e: <yada> [L]
#> • an_r6_instance: <A Class> [L]
#> • g: <2> [L]
#> • h: <fn> [L]
#> • ` a very !weird name`: <R6ClssGn> [L]
#> • .d_e: <env> [L]
#> • .d: <MltAssyE> [L]
#> • .f: <df[,5]> [L]

Created on 2024-12-20 with reprex v2.1.1

- Bindings:
R/qenv-show.R Outdated Show resolved Hide resolved
Co-authored-by: André Veríssimo <[email protected]>
Signed-off-by: Dawid Kałędkowski <[email protected]>
Copy link
Contributor

@averissimo averissimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks really good, repeated docs seem to be unified

@gogonzo gogonzo enabled auto-merge (squash) January 7, 2025 11:14
@gogonzo gogonzo merged commit 8c05112 into main Jan 7, 2025
30 checks passed
@gogonzo gogonzo deleted the 338_datanames_in_vignettes branch January 7, 2025 11:15
@github-actions github-actions bot locked and limited conversation to collaborators Jan 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants