Skip to content

Commit

Permalink
Add clarifications about load_node usability with IPython and add com…
Browse files Browse the repository at this point in the history
…ment around requirements (#3648)

Signed-off-by: Merel Theisen <[email protected]>
  • Loading branch information
merelcht committed Feb 22, 2024
1 parent 29aa27f commit 941440a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/source/development/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Our debugging documentation has moved. Please see our existing guides:
```

* [Debugging a Kedro project within a notebook](../notebooks_and_ipython/kedro_and_notebooks.md#debugging-a-kedro-project-within-a-notebook) for information on how to debug using the `%load_node` line magic and an interactive debugger.
* [Debugging a Kedro project within a notebook or IPython shell](../notebooks_and_ipython/kedro_and_notebooks.md#debugging-a-kedro-project-within-a-notebook) for information on how to debug using the `%load_node` line magic and an interactive debugger.
* [Debugging in VSCode](./set_up_vscode.md#debugging) for information on how to set up VSCode's built-in debugger.
* [Debugging in PyCharm](./set_up_pycharm.md#debugging) for information on using PyCharm's debugging tool.
* [Debugging in the CLI with Kedro Hooks](../hooks/common_use_cases.md#use-hooks-to-debug-your-pipeline) for information on how to automatically launch an interactive debugger in the CLI when an error occurs in your pipeline run.
9 changes: 7 additions & 2 deletions docs/source/notebooks_and_ipython/kedro_and_notebooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ For more details, run `%reload_kedro?`.
### `%load_node` line magic

``` {note}
This is still an experimental feature and is currently only available for Jupyter Notebook (>7.0) and Jupyter Lab. If you encounter unexpected behaviour or would like to suggest feature enhancements, add it under [this github issue](https://github.com/kedro-org/kedro/issues/3580).
This is still an experimental feature and is currently only available for Jupyter Notebook (>7.0), Jupyter Lab, IPython, and VSCode Notebook. If you encounter unexpected behaviour or would like to suggest feature enhancements, add it under [this github issue](https://github.com/kedro-org/kedro/issues/3580).
```

You can load the contents of a node in your project into a series of cells using the `%load_node` line magic.
Expand All @@ -242,12 +242,17 @@ Ensure you use the name of your node as defined in the pipeline, not the name of

</details>

---

To be able to access your node's inputs, make sure they are explicitly defined in your project's catalog.

You can then run the generated cells to recreate how the node would run in your pipeline. You can use this to explore your node's inputs, behaviour, and outputs in isolation, or for [debugging](#debugging-a-kedro-project-within-a-notebook).

When using this feature in Jupyter Notebook you will need to have the following requirements and minimum versions installed:
```yaml
ipylab>=1.0.0
notebook>=7.0.0
```

### `%run_viz` line magic

``` {note}
Expand Down
4 changes: 2 additions & 2 deletions kedro/ipython/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def _guess_run_environment() -> str: # pragma: no cover
)
def magic_load_node(args: str) -> None:
"""The line magic %load_node <node_name>.
Currently, this feature is only available for Jupyter Notebook (>7.0), Jupyter Lab
Currently, this feature is only available for Jupyter Notebook (>7.0), Jupyter Lab, IPython,
and VSCode Notebook. This line magic will generate code in multiple cells to load
datasets from `DataCatalog`, import relevant functions and modules, node function
definition and a function call. If generating code is not possible, it will print
Expand Down Expand Up @@ -270,7 +270,7 @@ def _load_node(node_name: str, pipelines: _ProjectPipelines) -> list[str]:
notebook cell.
"""
warnings.warn(
"This is an experimental feature, only Jupyter Notebook (>7.0) & Jupyter Lab "
"This is an experimental feature, only Jupyter Notebook (>7.0), Jupyter Lab, IPython, and VSCode Notebook "
"are supported. If you encounter unexpected behaviour or would like to suggest "
"feature enhancements, add it under this github issue https://github.com/kedro-org/kedro/issues/3580"
)
Expand Down

0 comments on commit 941440a

Please sign in to comment.