Initialize Report Project
The initialize_report_project()
function in the reportifyr
package creates a directory structure for report generation and ensures all necessary subdirectories are present. If required, it also initializes a Python virtual environment using reportifyr
’s initialize_python()
function.
initialize_report_project()
Returns
If the following directory structure does not exist within the provided project_dir
, it will be created:
report
draft
: Contains drafts of reports.final
: Contains final versions of reports.scripts
: Contains report scripts.shell
: Contains report shells.
OUTPUTS
figures
: Stores generated figures.tables
: Stores generated tables.listings
: Stores generated listings.
.venv
If a standard_footnotes.yaml
is not found within the report
subdirectory, a prompt stating:
> Copied standard_footnotes.yaml into /cluster-data/user-homes/user/project/report
If a .venv
is not found in the project_dir
, it initializes one using initialize_python()
and returns a prompt.
Logging
- Debug: Logs the start and end of the function, as well as the creation of certain subdirectories (e.g,
draft
,figures
,tables
, etc.). - Info: Logs when the
project_dir
is validated, whenreport
andOUTPUTS
subdirectories are created, and when the standard_footnotes.yaml file is copied over. - Error: Logs and stops execution if the
project_dir
does not exist.
Additional Resources
- reportifyr GitHub: Refer to the
reportifyr
repository for more details. - Initialize Python Reference: Refer to the reference on
initialize_python()
here.