-
Notifications
You must be signed in to change notification settings - Fork 449
Expand execute_notebook docstring to fully document optional parameters
#871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -43,8 +43,6 @@ def execute_notebook( | |||||||||||||||||||||||
| Name of execution engine to use | ||||||||||||||||||||||||
| request_save_on_cell_execute : bool, optional | ||||||||||||||||||||||||
| Request save notebook after each cell execution | ||||||||||||||||||||||||
| autosave_cell_every : int, optional | ||||||||||||||||||||||||
| How often in seconds to save in the middle of long cell executions | ||||||||||||||||||||||||
| prepare_only : bool, optional | ||||||||||||||||||||||||
| Flag to determine if execution should occur or not | ||||||||||||||||||||||||
| kernel_name : str, optional | ||||||||||||||||||||||||
|
|
@@ -55,14 +53,21 @@ def execute_notebook( | |||||||||||||||||||||||
| Flag for whether or not to show the progress bar. | ||||||||||||||||||||||||
| log_output : bool, optional | ||||||||||||||||||||||||
| Flag for whether or not to write notebook output to the configured logger | ||||||||||||||||||||||||
| stdout_file : str or file-like, optional | ||||||||||||||||||||||||
| File path or buffer used to write notebook stdout | ||||||||||||||||||||||||
| stderr_file : str or file-like, optional | ||||||||||||||||||||||||
| File path or buffer used to write notebook stderr | ||||||||||||||||||||||||
| start_timeout : int, optional | ||||||||||||||||||||||||
| Duration in seconds to wait for kernel start-up | ||||||||||||||||||||||||
| report_mode : bool, optional | ||||||||||||||||||||||||
| Flag for whether or not to hide input. | ||||||||||||||||||||||||
| cwd : str or Path, optional | ||||||||||||||||||||||||
| Working directory to use when executing the notebook | ||||||||||||||||||||||||
| **kwargs | ||||||||||||||||||||||||
| Arbitrary keyword arguments to pass to the notebook engine | ||||||||||||||||||||||||
| **engine_kwargs | ||||||||||||||||||||||||
| Arbitrary keyword arguments forwarded to the selected execution engine | ||||||||||||||||||||||||
| (and underlying nbclient execution). Common options include | ||||||||||||||||||||||||
| ``execution_timeout`` and ``autosave_cell_every``. Supported options | ||||||||||||||||||||||||
| may vary by engine | ||||||||||||||||||||||||
|
Comment on lines
+67
to
+70
|
||||||||||||||||||||||||
| Arbitrary keyword arguments forwarded to the selected execution engine | |
| (and underlying nbclient execution). Common options include | |
| ``execution_timeout`` and ``autosave_cell_every``. Supported options | |
| may vary by engine | |
| Additional keyword arguments for the selected execution engine. | |
| These are interpreted by the engine itself, which may forward a | |
| subset to nbclient (for nbclient-based engines) and/or handle them | |
| internally. Common options include ``execution_timeout`` (typically | |
| forwarded to nbclient) and ``autosave_cell_every`` (handled by | |
| Papermill's NotebookExecutionManager/engine wrapper). Supported | |
| options and their behavior may vary by engine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring says
stdout_file/stderr_filecan be a string path, but the default nbclient engine ultimately calls.write()/.flush()on these objects (see PapermillNotebookClient). Passing a path string via the Python API would fail at runtime. Consider documenting these as file-like text buffers (or explicitly supportingstrby opening the path internally).