Skip to content

[feat]: update_report() - #563

Open
Schiano-NOAA wants to merge 19 commits into
mainfrom
feat-update-report
Open

Schiano-NOAA wants to merge 19 commits into
mainfrom
feat-update-report

Conversation

@Schiano-NOAA

Copy link
Copy Markdown
Collaborator

What is the feature?

  • Addition of a new function for users to call the previous assessment report then update it according to arguments

How have you implemented the solution?

  • added a new function called update_report which uses the functionality of rerender_skeleton and other code

Does the PR impact any other area of the project, maybe another repo?

  • no

@github-actions

This comment has been minimized.

@Schiano-NOAA
Schiano-NOAA added this pull request to stack #567 September 17, 2026 17:35
@Schiano-NOAA Schiano-NOAA changed the title [feat]: update_report() [feat]: update_report() Sep 17, 2026
@Schiano-NOAA Schiano-NOAA added this to the September Release milestone Sep 17, 2026
@Schiano-NOAA Schiano-NOAA added the enhancement New feature or request label Sep 17, 2026
@Schiano-NOAA Schiano-NOAA self-assigned this Sep 17, 2026
@Schiano-NOAA Schiano-NOAA linked an issue Sep 17, 2026 that may be closed by this pull request
@Schiano-NOAA
Schiano-NOAA removed this pull request from stack #567 September 17, 2026 20:09
@Schiano-NOAA
Schiano-NOAA added this pull request to stack #571 September 17, 2026 20:09
@Schiano-NOAA
Schiano-NOAA removed this pull request from stack #571 September 22, 2026 13:42
@Schiano-NOAA
Schiano-NOAA added this pull request to stack #573 September 22, 2026 13:43
@Schiano-NOAA
Schiano-NOAA marked this pull request as draft September 23, 2026 15:17
@Schiano-NOAA
Schiano-NOAA marked this pull request as ready for review September 25, 2026 19:04
@Schiano-NOAA

Copy link
Copy Markdown
Collaborator Author

Note: tests in this use the rerende_skeleton() function which is not currently available in this branch but located in a PR in this stack. Once that PR is reviewed, it can be merged into this one or you can merge as a stack since the feat-rerender-skeleton branch also contains the tests and they should be passing.

Comment thread R/update_report.R
#' and figures Quarto documents.
#'
#' Default: FALSE
#' @returns Creates a new folder of pre-filled assessment report files for the

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this file needs a details section (or something similar) that more thoroughly explains what the function is capable of. For example, offering which parts of a report are eligible and likely to be updated: year, model results, etc.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'll make this update as you review

@sbreitbart-NOAA

Copy link
Copy Markdown
Collaborator

I'll hold off further reviewing because the function errors without adding in a rerender_skeleton.R file, among other functions not in this branch 👍

@Schiano-NOAA
Schiano-NOAA removed this pull request from stack #573 October 2, 2026 18:48
@Schiano-NOAA

Copy link
Copy Markdown
Collaborator Author

@sbreitbart-NOAA After this merges in and the bug for the bib_file is merged, I will do a release. Most likely monday or whenever this is merged in next week

* Add functionality to rename legacy figure/table docs with rerender_skeleton(); fix bug where tables docs weren't renamed in create_template()

* Remove code from create_template() associated with legacy fig/table names
Comment thread R/update_report.R
# section chunks
# TODO: reset author section in skeleton -- remove all previous authorship (does this work?)
# Update skeleton with new year, authors, model results, region, if added
rerender_skeleton(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not able to add new sections. I think this is failing in rerender_skeleton(), not update_report() itself. Ex:

dir.create("test_report")
create_template(bib_file = F)
update_report(previous_file_dir = "report", file_dir = "test_report", new_section = "Special Section", section_location = "after-introduction")

Comment thread R/update_report.R
cli::cli_alert_info("Figures document reset to default.")
}

if (reset_tables_and_figures) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is there a reason for having two if statements when it appears that these could be combined?

Comment thread R/update_report.R
)
)
# Create figures doc
create_figures_doc(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the figures and tables docs aren't being named correctly if type isn't "sar" (i.e., they're being named as if type = "sar").
In create_template(), the files are renamed based on type. But if type isn't provided here, one solution could be to identify type based on the child docs present (e.g., 08_abc signals type = "safe"), then rename accordingly

Comment thread R/utils.R
Comment on lines +558 to +559
# TODO: type - this needs to just pull all files from folder that
# it was copying from when custom sections is null -- DONE

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# TODO: type - this needs to just pull all files from folder that
# it was copying from when custom sections is null -- DONE

@sbreitbart-NOAA sbreitbart-NOAA left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Most of this works very well- just a few things to remediate before merging 👍

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Code Metrics Report

Coverage Code to Test Ratio Test Execution Time
48.2% 1:0.3 1m14s

Code coverage of files in pull request scope (65.1%, patch 62.4%)

Files Coverage Patch Coverage
R/add_authors.R 65.8% -
R/create_template.R 78.3% 76.9%
R/create_title.R 89.1% 100.0%
R/create_yaml.R 74.4% 100.0%
R/rerender_skeleton.R 51.0% 51.0%
R/update_report.R 96.0% 96.0%
R/utils.R 47.7% 33.3%

Reported by octocov

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: add feature to call previous report (in its own fxn)

2 participants