Skip to content

Commit 4ecf058

Browse files
committed
Normalize docs API and option links
1 parent 353ae15 commit 4ecf058

18 files changed

Lines changed: 117 additions & 101 deletions

docs/source/how_to_guides/bp_complex_task_repetitions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ to iterate over instances of this object in a single loop. Here and for the lack
3737
better name, we will call the object an experiment.
3838

3939
Lastly, we will also use the
40-
[pytask.DataCatalog](../api/core_classes_and_exceptions.md#pytask.DataCatalog) to not be
41-
bothered with defining paths.
40+
[`pytask.DataCatalog`](../api/core_classes_and_exceptions.md#pytask.DataCatalog) to not
41+
be bothered with defining paths.
4242

4343
!!! note
4444

@@ -68,7 +68,7 @@ we use them.
6868
As you see, we lost a level of indentation and we moved all the generations of names and
6969
paths to the dimensions and multi-dimensional objects.
7070

71-
Using a [pytask.PythonNode](../api/nodes_and_tasks.md#pytask.PythonNode) allows us to
71+
Using a [`pytask.PythonNode`](../api/nodes_and_tasks.md#pytask.PythonNode) allows us to
7272
hash the model and reexecute the task if we define other model settings.
7373

7474
## Adding another level

docs/source/how_to_guides/extending_pytask.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ More general information about pluggy can be found in its
1919
There are two ways to add new
2020
[hook implementations](../glossary.md#hook-implementation).
2121

22-
1. Using the `pytask build --hook-module` commandline option or the `hook_module`
23-
configuration value.
22+
1. Using the [`pytask build --hook-module`](../commands/build.md#options) commandline
23+
option or the `hook_module` configuration value.
2424
1. Packaging your [plugin](../glossary.md#plugin) as a Python package to publish and
2525
share it.
2626

docs/source/how_to_guides/hashing_inputs_of_tasks.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22

33
Any input to a task function is parsed by pytask's nodes. For example,
44
[`pathlib.Path`][]s are parsed by
5-
[pytask.PathNode](../api/nodes_and_tasks.md#pytask.PathNode)s. The
6-
[pytask.PathNode](../api/nodes_and_tasks.md#pytask.PathNode) handles among other things
5+
[`pytask.PathNode`](../api/nodes_and_tasks.md#pytask.PathNode)s. The
6+
[`pytask.PathNode`](../api/nodes_and_tasks.md#pytask.PathNode) handles among other things
77
how changes in the underlying file are detected.
88

99
If an input is not parsed by any more specific node type, the general
10-
[pytask.PythonNode](../api/nodes_and_tasks.md#pytask.PythonNode) is used.
10+
[`pytask.PythonNode`](../api/nodes_and_tasks.md#pytask.PythonNode) is used.
1111

1212
In the following example, the argument `text` will be parsed as a
13-
[pytask.PythonNode](../api/nodes_and_tasks.md#pytask.PythonNode).
13+
[`pytask.PythonNode`](../api/nodes_and_tasks.md#pytask.PythonNode).
1414

1515
```py
1616
--8<-- "docs_src/how_to_guides/hashing_inputs_of_tasks_example_1_py310.py"
1717
```
1818

1919
By default, pytask does not detect changes in
20-
[pytask.PythonNode](../api/nodes_and_tasks.md#pytask.PythonNode) and if the value would
20+
[`pytask.PythonNode`](../api/nodes_and_tasks.md#pytask.PythonNode) and if the value would
2121
change (without changing the task module), pytask would not rerun the task.
2222

2323
We can also hash the value of
24-
[pytask.PythonNode](../api/nodes_and_tasks.md#pytask.PythonNode)s so that pytask knows
24+
[`pytask.PythonNode`](../api/nodes_and_tasks.md#pytask.PythonNode)s so that pytask knows
2525
when the input changed. For that, we need to use the
26-
[pytask.PythonNode](../api/nodes_and_tasks.md#pytask.PythonNode) explicitly and set
26+
[`pytask.PythonNode`](../api/nodes_and_tasks.md#pytask.PythonNode) explicitly and set
2727
`hash = True`.
2828

2929
```py
@@ -54,7 +54,7 @@ information). pytask will hash them using the `hashlib` module to create a stabl
5454

5555
`list` and `dict` are not hashable by default. Luckily, there are libraries who provide
5656
this functionality like `deepdiff`. We can use them to pass a function to the
57-
[pytask.PythonNode](../api/nodes_and_tasks.md#pytask.PythonNode) that generates a stable
57+
[`pytask.PythonNode`](../api/nodes_and_tasks.md#pytask.PythonNode) that generates a stable
5858
hash.
5959

6060
First, install `deepdiff`.

docs/source/how_to_guides/interfaces_for_dependencies_products.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ You can pass a value to a task as a default argument.
3939
It is possible to include the value in the type annotation.
4040

4141
It is especially helpful if you pass a
42-
[pytask.PNode](../api/nodes_and_tasks.md#pytask.PNode) to the task. If you passed a node
43-
as the default argument, type checkers like mypy would expect the node to enter the
42+
[`pytask.PNode`](../api/nodes_and_tasks.md#pytask.PNode) to the task. If you passed a
43+
node as the default argument, type checkers like mypy would expect the node to enter the
4444
task, but the value injected into the task depends on the nodes
45-
[pytask.PNode.load](../api/nodes_and_tasks.md#pytask.PNode.load) method. For a
46-
[pytask.PathNode](../api/nodes_and_tasks.md#pytask.PathNode)
45+
[`pytask.PNode.load`](../api/nodes_and_tasks.md#pytask.PNode.load) method. For a
46+
[`pytask.PathNode`](../api/nodes_and_tasks.md#pytask.PathNode)
4747

4848
```py
4949
--8<-- "docs_src/how_to_guides/interfaces/dependencies_annotation.py"
@@ -72,7 +72,7 @@ applies to dependencies and products alike.
7272
### `Product` annotation
7373

7474
The syntax is the same as [default argument](#default-argument), but the
75-
[pytask.Product](../api/utilities_and_typing.md#pytask.Product) annotation turns the
75+
[`pytask.Product`](../api/utilities_and_typing.md#pytask.Product) annotation turns the
7676
argument into a task product.
7777

7878
```py
@@ -82,7 +82,7 @@ argument into a task product.
8282
### `Product` annotation with value
8383

8484
The syntax is the same as [annotation](#annotation), but the
85-
[pytask.Product](../api/utilities_and_typing.md#pytask.Product) annotation turns the
85+
[`pytask.Product`](../api/utilities_and_typing.md#pytask.Product) annotation turns the
8686
argument into a task product.
8787

8888
```py

docs/source/how_to_guides/migrating_from_scripts_to_pytask.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ An `if __name__ == "__main__"` block must be deleted.
5959
To let pytask know the order in which to execute tasks and when to re-run them, you'll
6060
need to specify task dependencies and products. Add dependencies as arguments to the
6161
function with default values. Do the same for products, but also add the special
62-
[pytask.Product](../api/utilities_and_typing.md#pytask.Product) annotation with
62+
[`pytask.Product`](../api/utilities_and_typing.md#pytask.Product) annotation with
6363
`Annotated[Path, Product]`. For example:
6464

6565
```py

docs/source/how_to_guides/provisional_nodes_and_task_generators.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ as the task module because it is a relative path.
2828
```
2929

3030
Since the names of the files are not known when pytask is started, we need to use a
31-
[pytask.DirectoryNode](../api/nodes_and_tasks.md#pytask.DirectoryNode) to define the
31+
[`pytask.DirectoryNode`](../api/nodes_and_tasks.md#pytask.DirectoryNode) to define the
3232
task's product. With a
33-
[pytask.DirectoryNode](../api/nodes_and_tasks.md#pytask.DirectoryNode) we can specify
33+
[`pytask.DirectoryNode`](../api/nodes_and_tasks.md#pytask.DirectoryNode) we can specify
3434
where pytask can find the files. The files are described with a root path (default is
3535
the directory of the task module) and a glob pattern (default is `*`).
3636

37-
When we use the [pytask.DirectoryNode](../api/nodes_and_tasks.md#pytask.DirectoryNode)
37+
When we use the [`pytask.DirectoryNode`](../api/nodes_and_tasks.md#pytask.DirectoryNode)
3838
as a product annotation, we get access to the `root_dir` as a
3939
[`pathlib.Path`][] object inside the function, which allows us to store
4040
the files.
@@ -64,11 +64,11 @@ downloaded.
6464
```
6565

6666
To reference the files that will be downloaded, we use
67-
[pytask.DirectoryNode](../api/nodes_and_tasks.md#pytask.DirectoryNode) as a dependency.
67+
[`pytask.DirectoryNode`](../api/nodes_and_tasks.md#pytask.DirectoryNode) as a dependency.
6868
Before the task is executed, the list of files in the folder defined by the root path
6969
and the pattern are automatically collected and passed to the task.
7070

71-
If we use a [pytask.DirectoryNode](../api/nodes_and_tasks.md#pytask.DirectoryNode) with
71+
If we use a [`pytask.DirectoryNode`](../api/nodes_and_tasks.md#pytask.DirectoryNode) with
7272
the same `root_dir` and `pattern` in both tasks, pytask will automatically recognize
7373
that the second task depends on the first. If that is not true, you might need to make
7474
this dependency more explicit by using `@task(after=...)`, which is explained

docs/source/how_to_guides/the_data_catalog.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# The `DataCatalog` - Revisited
22

33
This guide explains more details about the
4-
[pytask.DataCatalog](../api/core_classes_and_exceptions.md#pytask.DataCatalog) that were
5-
left out of the [tutorial](../tutorials/using_a_data_catalog.md). Please, read the
4+
[`pytask.DataCatalog`](../api/core_classes_and_exceptions.md#pytask.DataCatalog) that
5+
were left out of the [tutorial](../tutorials/using_a_data_catalog.md). Please, read the
66
tutorial for a basic understanding.
77

88
## Changing the default node
99

1010
The data catalog uses the
11-
[pytask.PickleNode](../api/nodes_and_tasks.md#pytask.PickleNode) by default to serialize
12-
any kind of Python object. You can use any other node that follows the
13-
[pytask.PNode](../api/nodes_and_tasks.md#pytask.PNode) protocol and register it when
11+
[`pytask.PickleNode`](../api/nodes_and_tasks.md#pytask.PickleNode) by default to
12+
serialize any kind of Python object. You can use any other node that follows the
13+
[`pytask.PNode`](../api/nodes_and_tasks.md#pytask.PNode) protocol and register it when
1414
creating the data catalog.
1515

16-
For example, use the [pytask.PythonNode](../api/nodes_and_tasks.md#pytask.PythonNode) as
17-
the default.
16+
For example, use the [`pytask.PythonNode`](../api/nodes_and_tasks.md#pytask.PythonNode)
17+
as the default.
1818

1919
```python
2020
from pytask import PythonNode
@@ -27,7 +27,7 @@ data_catalog = DataCatalog(default_node=PythonNode)
2727
Or, learn to write your node by reading [writing custom nodes](writing_custom_nodes.md).
2828

2929
Here, is an example for a
30-
[pytask.PickleNode](../api/nodes_and_tasks.md#pytask.PickleNode) that uses cloudpickle
30+
[`pytask.PickleNode`](../api/nodes_and_tasks.md#pytask.PickleNode) that uses cloudpickle
3131
instead of the normal `pickle` module.
3232

3333
```py

docs/source/how_to_guides/using_task_returns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ where the return of the function, a string, should be stored.
2222
```
2323

2424
It works because internally the path is converted to a
25-
[pytask.PathNode](../api/nodes_and_tasks.md#pytask.PathNode) that is able to store
25+
[`pytask.PathNode`](../api/nodes_and_tasks.md#pytask.PathNode) that is able to store
2626
objects of type `str` and `bytes`.
2727

2828
!!! note

docs/source/how_to_guides/writing_custom_nodes.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
In the previous tutorials and how-to guides, you learned that dependencies and products
44
can be represented as plain Python objects with
5-
[pytask.PythonNode](../api/nodes_and_tasks.md#pytask.PythonNode) or as paths where every
5+
[`pytask.PythonNode`](../api/nodes_and_tasks.md#pytask.PythonNode) or as paths where every
66
[`pathlib.Path`][] is converted to a
7-
[pytask.PathNode](../api/nodes_and_tasks.md#pytask.PathNode).
7+
[`pytask.PathNode`](../api/nodes_and_tasks.md#pytask.PathNode).
88

99
In this how-to guide, you will learn about the general concept of nodes and how to write
1010
your own to improve your workflows.
@@ -21,7 +21,7 @@ paths to point to inputs and outputs and call [`pandas.read_pickle`][] and
2121
```
2222

2323
To remove IO operations from the task and delegate them to pytask, we will replicate the
24-
[pytask.PickleNode](../api/nodes_and_tasks.md#pytask.PickleNode) that automatically
24+
[`pytask.PickleNode`](../api/nodes_and_tasks.md#pytask.PickleNode) that automatically
2525
loads and stores Python objects.
2626

2727
And we pass the value to `df` via [`typing.Annotated`][] to preserve
@@ -49,15 +49,15 @@ A custom node needs to follow an interface so that pytask can perform several ac
4949
- Load and save values when tasks are executed.
5050

5151
This interface is defined by protocols. A custom node must follow at least the protocol
52-
[pytask.PNode](../api/nodes_and_tasks.md#pytask.PNode) or, even better,
53-
[pytask.PPathNode](../api/nodes_and_tasks.md#pytask.PPathNode) if it is based on a path.
54-
The common node for paths, [pytask.PathNode](../api/nodes_and_tasks.md#pytask.PathNode),
55-
follows the protocol [pytask.PPathNode](../api/nodes_and_tasks.md#pytask.PPathNode).
52+
[`pytask.PNode`](../api/nodes_and_tasks.md#pytask.PNode) or, even better,
53+
[`pytask.PPathNode`](../api/nodes_and_tasks.md#pytask.PPathNode) if it is based on a path.
54+
The common node for paths, [`pytask.PathNode`](../api/nodes_and_tasks.md#pytask.PathNode),
55+
follows the protocol [`pytask.PPathNode`](../api/nodes_and_tasks.md#pytask.PPathNode).
5656

5757
## `PickleNode`
5858

59-
Since our [pytask.PickleNode](../api/nodes_and_tasks.md#pytask.PickleNode) will only
60-
vary slightly from [pytask.PathNode](../api/nodes_and_tasks.md#pytask.PathNode), we use
59+
Since our [`pytask.PickleNode`](../api/nodes_and_tasks.md#pytask.PickleNode) will only
60+
vary slightly from [`pytask.PathNode`](../api/nodes_and_tasks.md#pytask.PathNode), we use
6161
it as a template, and with some minor modifications, we arrive at the following class.
6262

6363
```py
@@ -67,7 +67,7 @@ it as a template, and with some minor modifications, we arrive at the following
6767
Here are some explanations.
6868

6969
- The node does not need to inherit from the protocol
70-
[pytask.PPathNode](../api/nodes_and_tasks.md#pytask.PPathNode), but you can do it to
70+
[`pytask.PPathNode`](../api/nodes_and_tasks.md#pytask.PPathNode), but you can do it to
7171
be more explicit.
7272

7373
- The node has two attributes
@@ -88,7 +88,7 @@ Here are some explanations.
8888
For custom nodes, make sure the lockfile id stays stable and unique within a task.
8989

9090
- The classmethod
91-
[pytask.PickleNode.from_path](../api/nodes_and_tasks.md#pytask.PickleNode.from_path)
91+
[`pytask.PickleNode.from_path`](../api/nodes_and_tasks.md#pytask.PickleNode.from_path)
9292
is a convenient method to instantiate the class.
9393

9494
- The method
@@ -101,7 +101,7 @@ Here are some explanations.
101101
[`pytask.PickleNode.load`](../api/nodes_and_tasks.md#pytask.PickleNode.load) when it
102102
collects the values of function arguments to run the function. The argument
103103
`is_product` signals that the node is loaded as a product with a
104-
[pytask.Product](../api/utilities_and_typing.md#pytask.Product) annotation or via
104+
[`pytask.Product`](../api/utilities_and_typing.md#pytask.Product) annotation or via
105105
`produces`.
106106

107107
When the node is loaded as a dependency, we want to inject the value of the pickle
@@ -127,8 +127,8 @@ Nodes are an important in concept pytask. They allow to pytask to build a
127127
IO operations from the task function into the nodes.
128128

129129
pytask only implements two node types,
130-
[pytask.PathNode](../api/nodes_and_tasks.md#pytask.PathNode) and
131-
[pytask.PythonNode](../api/nodes_and_tasks.md#pytask.PythonNode), but many more are
130+
[`pytask.PathNode`](../api/nodes_and_tasks.md#pytask.PathNode) and
131+
[`pytask.PythonNode`](../api/nodes_and_tasks.md#pytask.PythonNode), but many more are
132132
possible. In the future, there should probably be a [plugin](../glossary.md#plugin) that
133133
implements nodes for many other data sources like AWS S3 or databases. See
134134
[Kedro datasets](https://docs.kedro.org/en/stable/kedro_datasets.html) for one example.

docs/source/reference_guides/configuration.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ information.
113113
pytask can ignore files and directories and exclude some tasks or reduce the duration of
114114
the collection.
115115

116-
To ignore some file/folder via the command line, use the `--ignore` flag multiple times.
116+
To ignore some file/folder via the command line, use the
117+
[`--ignore`](../commands/build.md#options) flag multiple times.
117118

118119
```console
119120
$ pytask --ignore some_file.py --ignore some_directory/*
@@ -201,8 +202,9 @@ that provide additional features such as syntax highlighting and tab completion:
201202
pdbcls = "pdbp:Pdb"
202203
```
203204

204-
The custom debugger will be used when you invoke the `--pdb` flag for post-mortem
205-
debugging or when using `breakpoint()` in your task code.
205+
The custom debugger will be used when you invoke the
206+
[`--pdb`](../commands/build.md#options) flag for post-mortem debugging or when using
207+
`breakpoint()` in your task code.
206208

207209
### `show_errors_immediately`
208210

0 commit comments

Comments
 (0)