Skip to content

Commit ac0d26a

Browse files
updated dpcy
1 parent 442babe commit ac0d26a

6 files changed

Lines changed: 19 additions & 16 deletions

File tree

R/fn_make.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,14 +914,15 @@ make_s4_mthds_ls <- function (fns_dir_1L_chr = "data-raw/s4_fns")
914914
if (length(fn_nms_chr) > 0) {
915915
mthd_nms_chr <- env_ls$fns_path_chr %>% fs::path_file() %>%
916916
stringr::str_sub(end = -3)
917-
s4_mthds_ls <- mthd_nms_chr %>% purrr::map(~{
917+
mthds_ls <- mthd_nms_chr %>% purrr::map(~{
918918
mthd_nm_1L_chr <- .x
919919
mthd_fns_chr <- fn_nms_chr[fn_nms_chr %>% startsWith(paste0(mthd_nm_1L_chr,
920920
"_"))]
921921
cls_nms_chr <- mthd_fns_chr %>% stringr::str_remove(paste0(mthd_nm_1L_chr,
922922
"_"))
923923
mthd_fns_chr <- mthd_fns_chr %>% stats::setNames(cls_nms_chr)
924924
}) %>% stats::setNames(mthd_nms_chr)
925+
s4_mthds_ls <- list(mthds_ls = mthds_ls, env_ls = env_ls)
925926
}
926927
else {
927928
s4_mthds_ls <- NULL

R/fn_write.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ write_mthds_for_r3_or_r4_clss <- function (methods_tb, fn_ls, fn_types_lup, pkg_
103103
fn_types_lup = fn_types_lup))
104104
}
105105
#' Write ready4 S4 methods
106-
#' @description write_r4_mthds() is a Write function that writes a file to a specified local directory. Specifically, this function implements an algorithm to write ready4 s4 methods. The function returns Written files (a list of lists).
106+
#' @description write_r4_mthds() is a Write function that writes a file to a specified local directory. Specifically, this function implements an algorithm to write ready4 s4 methods. The function returns a S4 methods (a list).
107107
#' @param fns_dir_1L_chr Functions directory (a character vector of length one), Default: 'data-raw/s4_fns'
108108
#' @param fn_types_lup Function types (a lookup table), Default: NULL
109109
#' @param import_from_chr Import from (a character vector), Default: character(0)
110110
#' @param output_dir_1L_chr Output directory (a character vector of length one), Default: 'R'
111111
#' @param pkg_nm_1L_chr Package name (a character vector of length one), Default: character(0)
112-
#' @return Written files (a list of lists)
112+
#' @return a S4 methods (a list)
113113
#' @rdname write_r4_mthds
114114
#' @export
115115
#' @importFrom ready4fun get_dev_pkg_nm make_gnrc_imports
@@ -125,14 +125,14 @@ write_r4_mthds <- function (fns_dir_1L_chr = "data-raw/s4_fns", fn_types_lup = N
125125
import_from_chr <- ready4fun::make_gnrc_imports()
126126
s4_mthds_ls <- make_s4_mthds_ls(fns_dir_1L_chr)
127127
if (!is.null(s4_mthds_ls)) {
128-
written_files_ls_ls <- purrr::map2(s4_mthds_ls, names(s4_mthds_ls),
129-
~{
128+
written_files_ls_ls <- purrr::map2(s4_mthds_ls$mthds_ls,
129+
names(s4_mthds_ls$mthds_ls), ~{
130130
fn_name_1L_chr <- .y
131131
classes_chr <- names(.x)
132132
fns_chr <- unname(.x)
133133
purrr::map2(classes_chr, fns_chr, ~{
134134
class_nm_1L_chr <- .x
135-
fn <- env_ls$fns_env %>% purrr::pluck(.y)
135+
fn <- s4_mthds_ls$env_ls$fns_env %>% purrr::pluck(.y)
136136
fn_desc_chr <- rep(paste0(fn_name_1L_chr, " method applied to ",
137137
class_nm_1L_chr), 2)
138138
fn_outp_type_1L_chr <- ""
@@ -147,7 +147,7 @@ write_r4_mthds <- function (fns_dir_1L_chr = "data-raw/s4_fns", fn_types_lup = N
147147
else {
148148
written_files_ls_ls <- NULL
149149
}
150-
return(written_files_ls_ls)
150+
return(s4_mthds_ls)
151151
}
152152
#' Write script to make generic
153153
#' @description write_script_to_make_gnrc() is a Write function that writes a file to a specified local directory. Specifically, this function implements an algorithm to write script to make generic. The function is called for its side effects and does not return a value. WARNING: This function writes R scripts to your local environment. Make sure to only use if you want this behaviour

_pkgdown.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
home:
22
links:
33
- text: Manual - User (PDF)
4-
href: https://dataverse.harvard.edu/api/access/datafile/5342649
4+
href: https://dataverse.harvard.edu/api/access/datafile/5342686
55
- text: Manual - Developer (PDF)
6-
href: https://dataverse.harvard.edu/api/access/datafile/5342648
6+
href: https://dataverse.harvard.edu/api/access/datafile/5342685
77
- text: Project website
88
href: https://www.ready4-dev.com/
99
development:

data-raw/fns/make.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,14 +856,16 @@ make_s4_mthds_ls <- function(fns_dir_1L_chr = "data-raw/s4_fns"){
856856
fn_nms_chr <- env_ls$fns_env %>% names()
857857
if(length(fn_nms_chr)>0){
858858
mthd_nms_chr <- env_ls$fns_path_chr %>% fs::path_file() %>% stringr::str_sub(end=-3)
859-
s4_mthds_ls <- mthd_nms_chr %>%
859+
mthds_ls <- mthd_nms_chr %>%
860860
purrr::map(~{
861861
mthd_nm_1L_chr <- .x
862862
mthd_fns_chr <- fn_nms_chr[fn_nms_chr %>% startsWith(paste0(mthd_nm_1L_chr,"_"))]
863863
cls_nms_chr <- mthd_fns_chr %>% stringr::str_remove(paste0(mthd_nm_1L_chr,"_"))
864864
mthd_fns_chr <- mthd_fns_chr %>% stats::setNames(cls_nms_chr)
865865
}) %>%
866866
stats::setNames(mthd_nms_chr)
867+
s4_mthds_ls <- list(mthds_ls = mthds_ls,
868+
env_ls = env_ls)
867869
}else{
868870
s4_mthds_ls <- NULL
869871
}

data-raw/fns/write.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ write_r4_mthds <- function(fns_dir_1L_chr = "data-raw/s4_fns",
113113
import_from_chr <- ready4fun::make_gnrc_imports()
114114
s4_mthds_ls <- make_s4_mthds_ls(fns_dir_1L_chr)
115115
if(!is.null(s4_mthds_ls)){
116-
written_files_ls_ls <- purrr::map2(s4_mthds_ls,
117-
names(s4_mthds_ls),
116+
written_files_ls_ls <- purrr::map2(s4_mthds_ls$mthds_ls,
117+
names(s4_mthds_ls$mthds_ls),
118118
~{
119119
fn_name_1L_chr <- .y
120120
classes_chr <- names(.x)
@@ -123,7 +123,7 @@ write_r4_mthds <- function(fns_dir_1L_chr = "data-raw/s4_fns",
123123
fns_chr,
124124
~ {
125125
class_nm_1L_chr <- .x
126-
fn <- env_ls$fns_env %>% purrr::pluck(.y)
126+
fn <- s4_mthds_ls$env_ls$fns_env %>% purrr::pluck(.y)
127127
fn_desc_chr <- rep(paste0(fn_name_1L_chr," method applied to ",class_nm_1L_chr),2)
128128
fn_outp_type_1L_chr <- ""
129129
write_std_mthd(fn,
@@ -140,7 +140,7 @@ write_r4_mthds <- function(fns_dir_1L_chr = "data-raw/s4_fns",
140140
}else{
141141
written_files_ls_ls <- NULL
142142
}
143-
return(written_files_ls_ls)
143+
return(s4_mthds_ls)
144144
}
145145
write_scripts_to_mk_r3_cls <- function(name_stub_1L_chr,
146146
name_pfx_1L_chr,##

man/write_r4_mthds.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)