Skip to content

Commit 9c546ea

Browse files
authored
Apply product feedback to dvc.yaml snippets (#4255)
1 parent 1792615 commit 9c546ea

File tree

1 file changed

+40
-53
lines changed

1 file changed

+40
-53
lines changed

extension/snippets/dvc-yaml.code-snippets

Lines changed: 40 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -13,123 +13,110 @@
1313
"Pipeline Stage Template": {
1414
"prefix": "dvc-pipeline-stage",
1515
"body": [
16-
" ${1:stage name}:",
17-
" cmd: ${2:command for the stage, e.g. python train.py}",
16+
" ${1:train}:",
17+
" cmd: ${2:python train.py}",
1818
" deps:",
19-
" - ${3:list dependencies for the stage, e.g. train.py}",
19+
" - ${3:train.py}",
2020
" params:",
21-
" - ${4:list params file(s) for the stage, e.g params.yaml}",
22-
" metrics:",
23-
" - ${5:list metric file(s) for the stage, e.g metrics.json}",
21+
" - ${4:params.yaml:}",
2422
" outs:",
25-
" - ${6:list output(s) of the stage, e.g. model.pkl}"
23+
" - ${5:model.pkl}"
2624
],
2725
"description": "Stage template for dvc.yaml pipeline"
2826
},
29-
"Minimal Pipeline Stage Template": {
30-
"prefix": "dvc-pipeline-minimal-stage",
31-
"body": [
32-
" ${1:stage name}:",
33-
" cmd: ${2:command for the stage, e.g. python train.py}",
34-
" deps:",
35-
" - ${3:list dependencies for the stage, e.g. train.py}",
36-
" outs:",
37-
" - ${4:list output(s) of the stage, e.g. model.pkl}"
38-
],
39-
"description": "Minimal stage template for dvc.yaml pipeline"
40-
},
4127
"Foreach Pipeline Stage Template": {
4228
"prefix": "dvc-pipeline-foreach-stage",
4329
"body": [
44-
" ${1:stage name}:",
30+
" ${1:cleanups}:",
4531
" foreach:",
46-
" - ${2:list of simple values to iterate over}",
32+
" - ${2:raw1}",
33+
" - ${3:raw2}",
4734
" do:",
48-
" cmd: ${3:command to be run for each templated item, e.g python evaluate.py} \"\\${item}\"",
35+
" cmd: ${4:python clean.py} \"\\${item}\"",
4936
" outs:",
50-
" - \\${item}.${5:suffix for the templated output file, e.g. pkl}"
37+
" - \\${item}.${5:cln}"
5138
],
5239
"description": "Foreach stage template for dvc.yaml pipeline"
5340
},
5441
"Single File Plot Template": {
5542
"prefix": "dvc-plot-single",
5643
"body": [
57-
" - ${1:file, e.g. probs.json}:",
44+
" - ${1:probs.json}:",
5845
" template: ${2|linear,simple,scatter,smooth,confusion,confusion_normalized,bar_horizontal,bar_horizontal_sorted|}",
59-
" x: ${3:x values, e.g. actual}",
60-
" y: ${4: y values, e.g. predicted}",
61-
" title: ${5:title, e.g. Predicted Probabilities}"
46+
" x: ${3:actual}",
47+
" y: ${4:predicted}",
48+
" title: ${5:Predicted Probabilities}"
6249
],
6350
"description": "Single file dvc.yaml top level plot template"
6451
},
6552
"Multi-file Plot Template": {
6653
"prefix": "dvc-plot-multi",
6754
"body": [
68-
" - ${1:name, e.g. Accuracy}:",
55+
" - ${1:Accuracy}:",
6956
" template: ${2|linear,simple,scatter,smooth,confusion,confusion_normalized,bar_horizontal,bar_horizontal_sorted|}",
70-
" x: ${3:x values, e.g. step}",
57+
" x: ${3:step}",
7158
" y: ",
72-
" ${4:file, e.g. training/plots/metrics/train/acc.tsv}: ${5:y values, e.g. acc}",
73-
" ${6:file, e.g. training/plots/metrics/test/acc.tsv}: ${7:y values, e.g. acc}",
74-
" y_label: ${8:y label, e.g. accuracy}"
59+
" ${4:training/plots/metrics/train/acc.tsv}: ${5:acc}",
60+
" ${6:training/plots/metrics/test/acc.tsv}: ${7:acc}",
61+
" y_label: ${8:accuracy}"
7562
],
7663
"description": "Multi-file dvc.yaml top level plot template"
7764
},
7865
"Bar Horizontal Plot Template": {
7966
"prefix": "dvc-plot-bar-horizontal",
8067
"body": [
81-
" - ${1:file, e.g. hist.csv}:",
68+
" - ${1:hist.csv}:",
8269
" template: bar_horizontal",
83-
" x: ${2:x values, e.g. preds}",
84-
" y: ${3: y values, e.g. digit}",
85-
" title: ${4:title, e.g. Histogram of Predictions}"
70+
" x: ${2:preds}",
71+
" y: ${3:digit}",
72+
" title: ${4:Histogram of Predictions}"
8673
],
8774
"description": "Bar horizontal dvc.yaml top level plot template"
8875
},
8976
"Confusion Matrix Plot Template": {
9077
"prefix": "dvc-plot-confusion",
9178
"body": [
92-
" - ${1:name, e.g. Confusion Matrix}:",
79+
" - ${1:Confusion Matrix}:",
9380
" template: confusion",
94-
" x: ${2:x values, e.g. actual}",
81+
" x: ${2:actual}",
9582
" y:",
96-
" ${3:file, e.g. training/plots/sklearn/confusion_matrix.json}: ${4:y values, e.g. predicted}"
83+
" ${3:training/plots/sklearn/confusion_matrix.json}: ${4:predicted}"
9784
],
9885
"description": "Confusion matrix dvc.yaml top level plot template"
9986
},
10087
"Smooth Plot Template": {
10188
"prefix": "dvc-plot-smooth",
10289
"body": [
103-
" - ${1:file, e.g. acc.tsv}:",
104-
" x: ${2:x values, e.g. step}",
105-
" y: ${3: y values, e.g. acc}",
106-
" y_label: ${4: y label, e.g. accuracy}"
90+
" - ${1:acc.tsv}:",
91+
" x: ${2:step}",
92+
" y: ${3:acc}",
93+
" y_label: ${4:accuracy}"
10794
],
10895
"description": "Smooth dvc.yaml top level plot template"
10996
},
11097
"Artifact": {
11198
"prefix": "dvc-artifact",
11299
"body": [
113-
" ${1:artifact id, e.g. cv-data}:",
114-
" path: ${2:path to artifact, e.g. data/data.xml}",
115-
" type: ${3:type of artifact, e.g. data}",
116-
" desc: '${4:artifact description, e.g. Preprocessed data for CV classification}'",
100+
" ${1:cv-data}:",
101+
" path: ${2:data/data.xml}",
102+
" type: ${3:data}",
103+
" desc: '${4:Preprocessed data for CV classification}'",
117104
" labels:",
118-
" - ${5:list of labels, e.g. resnet50}"
105+
" - ${5:resnet50}"
119106
],
120107
"description": "dvc.yaml artifact template"
121108
},
122109
"Model Artifact": {
123110
"prefix": "dvc-artifact-model",
124111
"body": [
125-
" ${1:artifact id, e.g. cv-classification}:",
126-
" path: ${2:path to model, e.g. models/resnet.pt}",
112+
" ${1:cv-classification}:",
113+
" path: ${2:models/resnet.pt}",
127114
" type: model",
128-
" desc: '${3:model description, e.g. CV classification model, ResNet50}'",
115+
" desc: '${3:CV classification model, ResNet50}'",
129116
" labels:",
130-
" - ${4:list of labels, e.g. resnet50}",
117+
" - ${4:resnet50}",
131118
" meta:",
132-
" framework: ${5:framework name, e.g. pytorch}"
119+
" framework: ${5:pytorch}"
133120
],
134121
"description": "dvc.yaml model artifact template"
135122
}

0 commit comments

Comments
 (0)