You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-2Lines changed: 33 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ millrun --help
49
49
│ * notebook_dir_or_file TEXT Path to a notebook file or a directory containing notebooks. │
50
50
│ [default: None] │
51
51
│ [required] │
52
-
│ * params TEXT JSON file that contains parameters for notebook execution. Can │
52
+
│ * notebook_params TEXT JSON file that contains parameters for notebook execution. Can │
53
53
│ either be a 'list of dict' or 'dict of list'. │
54
54
│ [default: None] │
55
55
│ [required] │
@@ -140,6 +140,38 @@ Where each notebook given to millrun will execute against each dictionary in the
140
140
This format is offered as a convenience format. Internally, it is converted into "Format 1" prior to execution.
141
141
142
142
143
+
## CLI Profile execution
144
+
145
+
As of v0.2.0, `millrun` allows the creation of a "profiles" yaml file which prevents the need for typing really long commands on the command line, especially if, for a particular project, the commands are always going to be the same.
146
+
147
+
YAML format:
148
+
149
+
The format basically describes the kwargs required to execute the command.
150
+
151
+
The top level keys can be arbitrarily named but they represent one command execution.
152
+
The values underneath each top level key are the kwargs of the command.
153
+
154
+
The only required values are `notebook_dir_or_file` and `notebook_params`. All other params are optional.
155
+
156
+
```yaml
157
+
notebook1: # This is the name of the profile. A profile is equal to one command on the command line
Since millrun iterates over two dimensions (each notebook and then dict of parameters in the list), there are two ways of parellelizing:
@@ -153,7 +185,6 @@ However, this method becomes inefficient if you have MANY notebooks and only 1-3
153
185
154
186
If you need this use case then feel free to raise an issue and/or contribute a PR to implement it as an option for execution.
155
187
156
-
157
188
## Troubleshooting
158
189
159
190
There seems to be an un-planned-for behaviour (by me) with the parallel execution where if there is an error in the execution process, that iteration is simply skipped. I don't have any `try`/`except` in the code that causes this.
help=("Directory to place output files into. If not provided"
47
-
" the file directory will be used."),
48
-
)
34
+
notebook_dir_or_file: Annotated[
35
+
Optional[str],
36
+
typer.Argument(
37
+
help="Path to a notebook file or a directory containing notebooks.",
38
+
),
49
39
] =None,
50
-
prepend: Annotated[Optional[str], typer.Option(
51
-
help=("Prepend components to use on output filename."
52
-
"Can use dict keys from 'params' which will be evaluated."
53
-
"(Comma-separated values)."),
54
-
callback=lambdax: x.split(",") ifxelseNone
55
-
)
40
+
notebook_params: Annotated[
41
+
Optional[str],
42
+
typer.Argument(
43
+
help=(
44
+
"JSON file that contains parameters for notebook execution. "
45
+
"Can either be a 'list of dict' or 'dict of list'."
46
+
),
47
+
),
56
48
] =None,
57
-
append: Annotated[Optional[str], typer.Option(
58
-
help=("Append components to use on output filename."
59
-
"Can use dict keys from 'params' which will be evaluated."
60
-
"(Comma-separated values)."),
61
-
callback=lambdax: x.split(",") ifxelseNone
62
-
)
49
+
profile: Annotated[
50
+
Optional[str],
51
+
typer.Argument(
52
+
help=(
53
+
"A millrun YAML profile file that specifies the notebook_dir_or_file and notebook_params (along with additional options) instead of providing them directly."
54
+
),
55
+
),
56
+
] =None,
57
+
output_dir: Annotated[
58
+
Optional[str],
59
+
typer.Option(
60
+
help=(
61
+
"Directory to place output files into. If not provided"
62
+
" the current working directory will be used."
63
+
),
64
+
),
65
+
] =None,
66
+
prepend: Annotated[
67
+
Optional[str],
68
+
typer.Option(
69
+
help=(
70
+
"Prepend components to use on output filename."
71
+
"Can use dict keys from 'params' which will be evaluated."
72
+
"(Comma-separated values)."
73
+
),
74
+
callback=lambdax: x.split(",") ifxelseNone,
75
+
),
76
+
] =None,
77
+
append: Annotated[
78
+
Optional[str],
79
+
typer.Option(
80
+
help=(
81
+
"Append components to use on output filename."
82
+
"Can use dict keys from 'params' which will be evaluated."
0 commit comments