From 828136284f1348db4899857a8d26a04307b0e643 Mon Sep 17 00:00:00 2001 From: araikes Date: Thu, 26 Mar 2026 12:08:00 -0700 Subject: [PATCH 1/2] Update ModelArray roxygen This should fix the duplicate documentation of "usage" in ModelArray by separating the class and function roxygen. --- R/ModelArray_Constructor.R | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/R/ModelArray_Constructor.R b/R/ModelArray_Constructor.R index f16d709..e0e2203 100644 --- a/R/ModelArray_Constructor.R +++ b/R/ModelArray_Constructor.R @@ -1,16 +1,22 @@ # Exported Functions -### setClass of "ModelArray" ##### +#' ModelArray class +#' #' An S4 class to represent element-wise scalar data and statistics. #' #' @slot sources A list of source filenames -#' @slot scalars A list of element-wise scalar matrix -#' @slot results A list of statistical result matrix +#' @slot scalars A list of element-wise scalar matrices +#' @slot results A list of statistical result matrices #' @slot path Path to the h5 file on disk +#' +#' @name ModelArray-class +#' @rdname ModelArray-class +#' @keywords internal #' @importClassesFrom DelayedArray DelayedArray -ModelArray <- setClass( +NULL + +setClass( "ModelArray", - # contains="DelayedArray", slots = c( results = "list", sources = "list", @@ -43,21 +49,16 @@ ModelArraySeed <- function(filepath, name, type = NA) { -#' Load element-wise data from .h5 file as an ModelArray object +#' Construct a ModelArray object +#' +#' Load element-wise data from an .h5 file as a `ModelArray` object. #' -#' @details: -#' Tips for debugging: -#' if you run into this error: "Error in h(simpleError(msg, call)) : -#' error in evaluating the argument 'seed' in selecting a method for -#' function 'DelayedArray': HDF5. Symbol table. Can't open object." -#' Then please check if you give correct "scalar_types" - check via -#' rhdf5::h5ls(filename_for_h5) +#' @param filepath Path to an .h5 file +#' @param scalar_types Expected scalars +#' @param analysis_names The subfolder names for results in the .h5 file. +#' If empty (default), results are not read. #' -#' @param filepath file -#' @param scalar_types expected scalars -#' @param analysis_names the subfolder names for results in .h5 file. If empty -#' (default), results are not read. -#' @return ModelArray object +#' @return A `ModelArray` object #' @export #' @import methods #' @importFrom dplyr %>% From b17ec967a8a50dd644163891072cea7f5d8575c9 Mon Sep 17 00:00:00 2001 From: araikes Date: Thu, 26 Mar 2026 12:48:26 -0700 Subject: [PATCH 2/2] Update Rd files --- DESCRIPTION | 2 +- man/ModelArray-class.Rd | 21 +++++++++++++++++++++ man/ModelArray.Rd | 39 +++++++-------------------------------- 3 files changed, 29 insertions(+), 33 deletions(-) create mode 100644 man/ModelArray-class.Rd diff --git a/DESCRIPTION b/DESCRIPTION index 3d74ee8..77882dd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -40,7 +40,7 @@ Imports: rlang, tibble, tidyr -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.3 Suggests: rmarkdown, knitr, diff --git a/man/ModelArray-class.Rd b/man/ModelArray-class.Rd new file mode 100644 index 0000000..2f89cd0 --- /dev/null +++ b/man/ModelArray-class.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ModelArray_Constructor.R +\name{ModelArray-class} +\alias{ModelArray-class} +\title{ModelArray class} +\description{ +An S4 class to represent element-wise scalar data and statistics. +} +\section{Slots}{ + +\describe{ +\item{\code{sources}}{A list of source filenames} + +\item{\code{scalars}}{A list of element-wise scalar matrices} + +\item{\code{results}}{A list of statistical result matrices} + +\item{\code{path}}{Path to the h5 file on disk} +}} + +\keyword{internal} diff --git a/man/ModelArray.Rd b/man/ModelArray.Rd index defb99a..6d13363 100644 --- a/man/ModelArray.Rd +++ b/man/ModelArray.Rd @@ -2,46 +2,21 @@ % Please edit documentation in R/ModelArray_Constructor.R \name{ModelArray} \alias{ModelArray} -\title{An S4 class to represent element-wise scalar data and statistics.} +\title{Construct a ModelArray object} \usage{ -ModelArray(filepath, scalar_types = c("FD"), analysis_names = character(0)) - ModelArray(filepath, scalar_types = c("FD"), analysis_names = character(0)) } \arguments{ -\item{filepath}{file} +\item{filepath}{Path to an .h5 file} -\item{scalar_types}{expected scalars} +\item{scalar_types}{Expected scalars} -\item{analysis_names}{the subfolder names for results in .h5 file. If empty -(default), results are not read.} +\item{analysis_names}{The subfolder names for results in the .h5 file. +If empty (default), results are not read.} } \value{ -ModelArray object +A `ModelArray` object } \description{ -An S4 class to represent element-wise scalar data and statistics. - -Load element-wise data from .h5 file as an ModelArray object +Load element-wise data from an .h5 file as a `ModelArray` object. } -\details{ -: -Tips for debugging: -if you run into this error: "Error in h(simpleError(msg, call)) : -error in evaluating the argument 'seed' in selecting a method for -function 'DelayedArray': HDF5. Symbol table. Can't open object." -Then please check if you give correct "scalar_types" - check via -rhdf5::h5ls(filename_for_h5) -} -\section{Slots}{ - -\describe{ -\item{\code{sources}}{A list of source filenames} - -\item{\code{scalars}}{A list of element-wise scalar matrix} - -\item{\code{results}}{A list of statistical result matrix} - -\item{\code{path}}{Path to the h5 file on disk} -}} -