Skip to content

Commit

Permalink
Apply product feedback to dvc.yaml snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon committed Jul 11, 2023
1 parent 96690dd commit 831a046
Showing 1 changed file with 40 additions and 53 deletions.
93 changes: 40 additions & 53 deletions extension/snippets/dvc-yaml.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -13,123 +13,110 @@
"Pipeline Stage Template": {
"prefix": "dvc-pipeline-stage",
"body": [
" ${1:stage name}:",
" cmd: ${2:command for the stage, e.g. python train.py}",
" ${1:train}:",
" cmd: ${2:python train.py}",
" deps:",
" - ${3:list dependencies for the stage, e.g. train.py}",
" - ${3:train.py}",
" params:",
" - ${4:list params file(s) for the stage, e.g params.yaml}",
" metrics:",
" - ${5:list metric file(s) for the stage, e.g metrics.json}",
" - ${4:params.yaml:}",
" outs:",
" - ${6:list output(s) of the stage, e.g. model.pkl}"
" - ${5:model.pkl}"
],
"description": "Stage template for dvc.yaml pipeline"
},
"Minimal Pipeline Stage Template": {
"prefix": "dvc-pipeline-minimal-stage",
"body": [
" ${1:stage name}:",
" cmd: ${2:command for the stage, e.g. python train.py}",
" deps:",
" - ${3:list dependencies for the stage, e.g. train.py}",
" outs:",
" - ${4:list output(s) of the stage, e.g. model.pkl}"
],
"description": "Minimal stage template for dvc.yaml pipeline"
},
"Foreach Pipeline Stage Template": {
"prefix": "dvc-pipeline-foreach-stage",
"body": [
" ${1:stage name}:",
" ${1:cleanups}:",
" foreach:",
" - ${2:list of simple values to iterate over}",
" - ${2:raw1}",
" - ${3:raw2}",
" do:",
" cmd: ${3:command to be run for each templated item, e.g python evaluate.py} \"\\${item}\"",
" cmd: ${4:python clean.py} \"\\${item}\"",
" outs:",
" - \\${item}.${5:suffix for the templated output file, e.g. pkl}"
" - \\${item}.${5:cln}"
],
"description": "Foreach stage template for dvc.yaml pipeline"
},
"Single File Plot Template": {
"prefix": "dvc-plot-single",
"body": [
" - ${1:file, e.g. probs.json}:",
" - ${1:probs.json}:",
" template: ${2|linear,simple,scatter,smooth,confusion,confusion_normalized,bar_horizontal,bar_horizontal_sorted|}",
" x: ${3:x values, e.g. actual}",
" y: ${4: y values, e.g. predicted}",
" title: ${5:title, e.g. Predicted Probabilities}"
" x: ${3:actual}",
" y: ${4:predicted}",
" title: ${5:Predicted Probabilities}"
],
"description": "Single file dvc.yaml top level plot template"
},
"Multi-file Plot Template": {
"prefix": "dvc-plot-multi",
"body": [
" - ${1:name, e.g. Accuracy}:",
" - ${1:Accuracy}:",
" template: ${2|linear,simple,scatter,smooth,confusion,confusion_normalized,bar_horizontal,bar_horizontal_sorted|}",
" x: ${3:x values, e.g. step}",
" x: ${3:step}",
" y: ",
" ${4:file, e.g. training/plots/metrics/train/acc.tsv}: ${5:y values, e.g. acc}",
" ${6:file, e.g. training/plots/metrics/test/acc.tsv}: ${7:y values, e.g. acc}",
" y_label: ${8:y label, e.g. accuracy}"
" ${4:training/plots/metrics/train/acc.tsv}: ${5:acc}",
" ${6:training/plots/metrics/test/acc.tsv}: ${7:acc}",
" y_label: ${8:accuracy}"
],
"description": "Multi-file dvc.yaml top level plot template"
},
"Bar Horizontal Plot Template": {
"prefix": "dvc-plot-bar-horizontal",
"body": [
" - ${1:file, e.g. hist.csv}:",
" - ${1:hist.csv}:",
" template: bar_horizontal",
" x: ${2:x values, e.g. preds}",
" y: ${3: y values, e.g. digit}",
" title: ${4:title, e.g. Histogram of Predictions}"
" x: ${2:preds}",
" y: ${3:digit}",
" title: ${4:Histogram of Predictions}"
],
"description": "Bar horizontal dvc.yaml top level plot template"
},
"Confusion Matrix Plot Template": {
"prefix": "dvc-plot-confusion",
"body": [
" - ${1:name, e.g. Confusion Matrix}:",
" - ${1:Confusion Matrix}:",
" template: confusion",
" x: ${2:x values, e.g. actual}",
" x: ${2:actual}",
" y:",
" ${3:file, e.g. training/plots/sklearn/confusion_matrix.json}: ${4:y values, e.g. predicted}"
" ${3:training/plots/sklearn/confusion_matrix.json}: ${4:predicted}"
],
"description": "Confusion matrix dvc.yaml top level plot template"
},
"Smooth Plot Template": {
"prefix": "dvc-plot-smooth",
"body": [
" - ${1:file, e.g. acc.tsv}:",
" x: ${2:x values, e.g. step}",
" y: ${3: y values, e.g. acc}",
" y_label: ${4: y label, e.g. accuracy}"
" - ${1:acc.tsv}:",
" x: ${2:step}",
" y: ${3:acc}",
" y_label: ${4:accuracy}"
],
"description": "Smooth dvc.yaml top level plot template"
},
"Artifact": {
"prefix": "dvc-artifact",
"body": [
" ${1:artifact id, e.g. cv-data}:",
" path: ${2:path to artifact, e.g. data/data.xml}",
" type: ${3:type of artifact, e.g. data}",
" desc: '${4:artifact description, e.g. Preprocessed data for CV classification}'",
" ${1:cv-data}:",
" path: ${2:data/data.xml}",
" type: ${3:data}",
" desc: '${4:Preprocessed data for CV classification}'",
" labels:",
" - ${5:list of labels, e.g. resnet50}"
" - ${5:resnet50}"
],
"description": "dvc.yaml artifact template"
},
"Model Artifact": {
"prefix": "dvc-artifact-model",
"body": [
" ${1:artifact id, e.g. cv-classification}:",
" path: ${2:path to model, e.g. models/resnet.pt}",
" ${1:cv-classification}:",
" path: ${2:models/resnet.pt}",
" type: model",
" desc: '${3:model description, e.g. CV classification model, ResNet50}'",
" desc: '${3:CV classification model, ResNet50}'",
" labels:",
" - ${4:list of labels, e.g. resnet50}",
" - ${4:resnet50}",
" meta:",
" framework: ${5:framework name, e.g. pytorch}"
" framework: ${5:pytorch}"
],
"description": "dvc.yaml model artifact template"
}
Expand Down

0 comments on commit 831a046

Please sign in to comment.