-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add python stages * Update CHANGELOG * Fix dvc.yaml * Update docs
- Loading branch information
Showing
28 changed files
with
167 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
stages: | ||
{{ stage_name }}: | ||
params: | ||
- dso.quarto | ||
deps: | ||
- src/{{ stage_name }}.ipynb | ||
outs: | ||
- output | ||
- report/{{ stage_name }}.html | ||
cmd: | ||
- uv run dso exec quarto . |
File renamed without changes.
File renamed without changes.
64 changes: 64 additions & 0 deletions
64
src/dso/templates/stage/quarto_ipynb/src/{{ stage_name }}.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# | label: load_libraries\n", | ||
"\n", | ||
"import pandas as pd\n", | ||
"\n", | ||
"from dso import read_params, stage_here" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Load the stage-specific 'params.yaml' config using the `read_params(..)` function. This function specifically loads\n", | ||
"only the stage-dependent parameters that are defined in the 'params' section of the 'dvc.yaml' file." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# | label: read_params\n", | ||
"\n", | ||
"params = read_params(\"{{ stage_path }}\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"To locate your files relative to the stage path use `stage_here(..)`." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# | label: obtain_files_relative_to_stage_dir\n", | ||
"\n", | ||
"# e.g.\n", | ||
"samplesheet = pd.read_csv(stage_here(params[\"samplesheet\"]))" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/log | ||
/tmp | ||
/temp | ||
/input/* | ||
!/input/*.dvc | ||
/output/* | ||
/report/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# {{ stage_name }} | ||
|
||
{{ stage_description }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
stages: | ||
{{ stage_name }}: | ||
params: | ||
- dso.quarto | ||
deps: | ||
- src/{{ stage_name }}.qmd | ||
outs: | ||
- output | ||
- report/{{ stage_name }}.html | ||
cmd: | ||
- uv run dso exec quarto . |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/.quarto/ | ||
/*.html | ||
# temporary quarto files | ||
*.rmarkdown | ||
/_quarto.yml | ||
/*_files/ |
25 changes: 25 additions & 0 deletions
25
src/dso/templates/stage/quarto_py/src/{{ stage_name }}.qmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
```{python} | ||
# | label: load_libraries | ||
from dso import read_params, stage_here | ||
import pandas as pd | ||
``` | ||
|
||
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. | ||
|
||
```{python} | ||
#| label: read_params | ||
params = read_params("{{ stage_path }}") | ||
``` | ||
|
||
|
||
To locate your files relative to the stage path use `stage_here(..)`. | ||
|
||
```{python} | ||
# | label: obtain_files_relative_to_stage_dir | ||
# e.g. | ||
samplesheet = pd.read_csv(stage_here(params["samplesheet"])) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/log | ||
/tmp | ||
/temp | ||
/input/* | ||
!/input/*.dvc | ||
/output/* | ||
/report/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# {{ stage_name }} | ||
|
||
{{ stage_description }} |
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/.quarto/ | ||
/*.html | ||
# temporary quarto files | ||
*.rmarkdown | ||
/_quarto.yml | ||
/*_files/ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters