Skip to content

Commit

Permalink
Added reload to {{ stage_name }}.qmd (#40)
Browse files Browse the repository at this point in the history
* Added reload to {{ stage_name }}.qmd

Added the dso-r reload() functionality to the stage template and added additional beginner friendly explanation and more user friendly layout to the template.

* pre-commit autofixes

* Modified description

* pre-commit autofixes

* Modified {{ stage_name }}.qmd

This changes incorporate @grst comments to have a functional template with comments, but a compromise to cover the most important key learning aspects for beginners in the comments.

* pre-commit autofixes

* Revert "pre-commit autofixes"

This reverts commit 8aa245d.

* Revert "Modified {{ stage_name }}.qmd"

This reverts commit 67051ca.

* Update CHANGELOG

---------

Co-authored-by: tschwarzl <[email protected]>
Co-authored-by: Gregor Sturm <[email protected]>
  • Loading branch information
3 people authored Nov 4, 2024
1 parent bbfe7ca commit 0742b69
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning][].
[keep a changelog]: https://keepachangelog.com/en/1.0.0/
[semantic versioning]: https://semver.org/spec/v2.0.0.html

## [Unreleased]

- Improve instruction text in quarto template to get users started more quickly ([#40](https://github.com/Boehringer-Ingelheim/dso/pull/40))

## v0.9.0

### New Features
Expand Down
17 changes: 14 additions & 3 deletions src/dso/templates/stage/quarto/src/{{ stage_name }}.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,29 @@ require(conflicted)
require(dso)
```

Load the stage-specific 'params.yaml' config using the `read_params(..)` function. This function specifically loads
only the stage-dependent parameters that are defined in the 'params' section of the 'dvc.yaml' file.

```{r}
#| label: read_params
# read_params sets the stage directory, runs 'dso compile-config'
# and loads params defined in the 'dvc.yaml' 'params' section of the stage
params <- read_params("{{ stage_path }}")
```

When modifying the 'dvc.yaml', 'params.in.yaml', or 'params.yaml' files during development, use the 'reload(params)'
function to ensure proper application of the changes by rebuilding and reloading the configuration.

```{r}
#| label: reload_params
reload(params)
```

To locate your files relative to the stage path use `stage_here(..)`.

```{r}
#| label: obtain_files_relative_to_stage_dir
# stage_here locates your files relative to the stage path set in read_params
# e.g.
samplesheet <- readr::read_csv(stage_here(params$samplesheet))
```

0 comments on commit 0742b69

Please sign in to comment.