Skip to content

Missing docs for archive.R #132

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

Closed
dajmcdon opened this issue Jun 29, 2022 · 2 comments · Fixed by #393
Closed

Missing docs for archive.R #132

dajmcdon opened this issue Jun 29, 2022 · 2 comments · Fixed by #393
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers P2 low priority

Comments

@dajmcdon
Copy link
Contributor

I think the documentation on main was behind. I just updated and force pushed. But I got a slew of warnings for undocumented R6 methods and functions in archive.R. Do we need to add those?

@brookslogan
Copy link
Contributor

brookslogan commented Jul 8, 2022

Yes, we should probably add these. I think they are just a bunch of missing @param tags on the R6 methods. We should add these and have each R6 @param point to the non-R6 functions for the docs (with actual links, e.g.,

@param param same as in [`epix_fn_name`]

since we have markdown enabled.)

I recently messed around trying to look for a better way to share docs between the R6 and non-R6 versions of functions, but I think the approach above will be simpler, easier to catch doc bugs, and maybe even favorable on the reader's side. It's tricky because currently, a lot of roxygen tags don't work on R6 methods, and instead end up ignored or place output in the wrong spot. The only thing I could get working:

  • We can share some R6 method and non-R6 docs for the params, a bit awkwardly. In the roxygen comments in the first block for the R6 class (not the method), we can use @template and even take advantage of @templateVar to clarify between self and x. But only when there is no overlap in parameter names among all the methods, or if there is overlap, we're okay with having identical documentation for all instances of that param. (@inheritParams might also work, but doesn't allow @templateVar, and makes accidental name overlap more likely if it does work.) But then we have to look up to the R6 initial class documentation block to see what params have been documented by looking at the templates, and maybe even look within the templates to see what params they cover. And when "reading" the non-R6 doc, we have to look at the non-param doc in one file, then jump to one/more template files to look at their docs. Not all that convenient, and it makes it easier to overlook doc bugs.

@brookslogan brookslogan added P2 low priority documentation Improvements or additions to documentation good first issue Good for newcomers labels Jul 25, 2022
@brookslogan
Copy link
Contributor

Tagged as P2 because while it seems pretty minor, it also may make use overlook actual issues with the R6 documentation. Also the approach I suggested above is pretty easy to implement.

The complaints should appear as "warnings" in devtools::check(vignettes=FALSE), but aren't tallied with the rest of the notes, warnings, and errors; they just appear somewhere in the console output. The fix is to add the missing @param documentation for the R6 methods, something along the lines of

@param x same as in [`epix_wrapper_fn_name_for_this_method`]

(The epix_wrapper_fn_name_for_this_method function should already have been implemented, in methods-epi_archive.R.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers P2 low priority
Development

Successfully merging a pull request may close this issue.

2 participants