Skip to content

Commit 792570c

Browse files
committed
Refine docs cross references
1 parent a7f8d90 commit 792570c

12 files changed

Lines changed: 70 additions & 50 deletions

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and
77

88
## Unreleased
99

10-
- {pull}`787` makes the `attributes` field mandatory on `PNode` and
10+
- [#787](https://github.com/pytask-dev/pytask/pull/787) makes the `attributes` field mandatory on `PNode` and
1111
`PProvisionalNode`, and preserves existing node attributes when loading entries from
1212
the data catalog.
13-
- {pull}`744` Removed the direct dependency on attrs and migrated internal models to
13+
- [#744](https://github.com/pytask-dev/pytask/pull/744) removes the direct dependency on attrs and migrates internal models to
1414
dataclasses.
1515
- [#766](https://github.com/pytask-dev/pytask/pull/766) moves runtime profiling persistence from SQLite to a JSON snapshot plus
1616
append-only journal in `.pytask/`, keeping runtime data resilient to crashes and
1717
compacted on normal build exits.
1818
- [#776](https://github.com/pytask-dev/pytask/pull/776) clears decoration-time `annotation_locals` snapshots after collection so
1919
task functions remain picklable in process-based parallel backends.
20-
- {pull}`788` updates debugger interaction tests to support Python-version-specific
20+
- [#788](https://github.com/pytask-dev/pytask/pull/788) updates debugger interaction tests to support Python-version-specific
2121
`pdb` stepping behavior and avoid frame-specific assumptions on repeated breakpoints.
2222

2323
## 0.5.8 - 2025-12-30

docs/source/api/utilities_and_typing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
options:
77
show_root_heading: true
88
show_signature: true
9+
::: pytask.get_state_of_path
910
::: pytask.path.hash_path
1011

1112
## Tree Utilities

docs/source/how_to_guides/capture_warnings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ configured by the `filterwarnings` configuration option.
6262
!!! important
6363

6464
Note that the type of warning needs to be importable. For example, `UserWarning` is a
65-
built-in warning with no module specified. `SettingWithCopyWarning` though needs to be
66-
imported from `pandas.errors`.
65+
built-in warning with no module specified. \[`pandas.errors.SettingWithCopyWarning`\][]
66+
though needs to be imported from \[`pandas.errors`\][].
6767

6868
## Disabling warnings summary
6969

docs/source/how_to_guides/hashing_inputs_of_tasks.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Hashing inputs of tasks
22

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

docs/source/how_to_guides/provisional_nodes_and_task_generators.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,20 @@ where pytask can find the files. The files are described with a root path (defau
3535
the directory of the task module) and a glob pattern (default is `*`).
3636

3737
When we use the [pytask.DirectoryNode](../api/nodes_and_tasks.md#pytask.DirectoryNode)
38-
as a product annotation, we get access to the `root_dir` as a `pathlib.Path` object
39-
inside the function, which allows us to store the files.
38+
as a product annotation, we get access to the `root_dir` as a \[`pathlib.Path`\][]
39+
object inside the function, which allows us to store the files.
4040

4141
!!! note
4242

43-
The `pytask.DirectoryNode` is a provisional node that implements
44-
`pytask.PProvisionalNode`. A provisional node is not a `pytask.PNode`, but when its
45-
`pytask.PProvisionalNode.collect` method is called, it returns actual nodes. A
46-
`pytask.DirectoryNode`, for example, returns `pytask.PathNode`.
43+
The [`pytask.DirectoryNode`](../api/nodes_and_tasks.md#pytask.DirectoryNode) is a
44+
provisional node that implements
45+
[`pytask.PProvisionalNode`](../api/nodes_and_tasks.md#pytask.PProvisionalNode). A
46+
provisional node is not a [`pytask.PNode`](../api/nodes_and_tasks.md#pytask.PNode), but
47+
when its
48+
[`pytask.PProvisionalNode.collect`](../api/nodes_and_tasks.md#pytask.PProvisionalNode.collect)
49+
method is called, it returns actual nodes. A
50+
[`pytask.DirectoryNode`](../api/nodes_and_tasks.md#pytask.DirectoryNode), for example,
51+
returns a [`pytask.PathNode`](../api/nodes_and_tasks.md#pytask.PathNode).
4752

4853
## Depending on provisional nodes
4954

@@ -57,8 +62,8 @@ downloaded.
5762
--8<-- "docs_src/how_to_guides/provisional_task.py"
5863
```
5964

60-
To reference the files that will be downloaded, we use the
61-
[pytask.DirectoryNode](../api/nodes_and_tasks.md#pytask.DirectoryNode) is a dependency.
65+
To reference the files that will be downloaded, we use
66+
[pytask.DirectoryNode](../api/nodes_and_tasks.md#pytask.DirectoryNode) as a dependency.
6267
Before the task is executed, the list of files in the folder defined by the root path
6368
and the pattern are automatically collected and passed to the task.
6469

docs/source/how_to_guides/remote_files.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ lots of use cases to deal with remote files.
88
- You store the workflow results in remote storage to save and distribute them.
99

1010
pytask uses [universal-pathlib](https://github.com/fsspec/universal_pathlib) to work
11-
with remote files. The package provides a `pathlib`-like interface, making it very easy
12-
to interact with files from an HTTP(S)-, Dropbox-, S3-, GCP-, Azure-based filesystem,
13-
and many more.
11+
with remote files. The package provides a \[`pathlib`\][]-like interface, making it very
12+
easy to interact with files from an HTTP(S)-, Dropbox-, S3-, GCP-, Azure-based
13+
filesystem, and many more.
1414

1515
## HTTP(S)-based filesystem
1616

docs/source/how_to_guides/writing_custom_nodes.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33
In the previous tutorials and how-to guides, you learned that dependencies and products
44
can be represented as plain Python objects with
55
[pytask.PythonNode](../api/nodes_and_tasks.md#pytask.PythonNode) or as paths where every
6-
`pathlib.Path` is converted to a
6+
\[`pathlib.Path`\][] is converted to a
77
[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.
1111

1212
## Use-case
1313

14-
A typical task operation is to load data like a `pandas.DataFrame` from a pickle file,
15-
transform it, and store it on disk. The usual way would be to use paths to point to
16-
inputs and outputs and call `pandas.read_pickle` and `pandas.DataFrame.to_pickle`.
14+
A typical task operation is to load data like a \[`pandas.DataFrame`\][] from a pickle
15+
file, transform it, and store it on disk. The usual way would be to use paths to point
16+
to inputs and outputs and call \[`pandas.read_pickle`\][] and
17+
\[`pandas.DataFrame.to_pickle`\][].
1718

1819
```py
1920
--8<-- "docs_src/how_to_guides/writing_custom_nodes_example_1.py"
@@ -23,7 +24,7 @@ To remove IO operations from the task and delegate them to pytask, we will repli
2324
[pytask.PickleNode](../api/nodes_and_tasks.md#pytask.PickleNode) that automatically
2425
loads and stores Python objects.
2526

26-
And we pass the value to `df` via `typing.Annotated` to preserve the type hint.
27+
And we pass the value to `df` via \[`typing.Annotated`\][] to preserve the type hint.
2728

2829
The result will be the following task.
2930

@@ -82,28 +83,34 @@ Here are some explanations.
8283
[pytask.PickleNode.from_path](../api/nodes_and_tasks.md#pytask.PickleNode.from_path)
8384
is a convenient method to instantiate the class.
8485

85-
- The method `pytask.PickleNode.state` yields a value that signals the node's state. If
86-
the value changes, pytask knows it needs to regenerate the workflow. We can use the
87-
timestamp of when the node was last modified.
86+
- The method
87+
[`pytask.PickleNode.state`](../api/nodes_and_tasks.md#pytask.PickleNode.state) yields
88+
a value that signals the node's state. If the value changes, pytask knows it needs
89+
to regenerate the workflow. We can use the timestamp of when the node was last
90+
modified.
8891

89-
- pytask calls `pytask.PickleNode.load` when it collects the values of function
90-
arguments to run the function. The argument `is_product` signals that the node is
91-
loaded as a product with a
92+
- pytask calls
93+
[`pytask.PickleNode.load`](../api/nodes_and_tasks.md#pytask.PickleNode.load) when it
94+
collects the values of function arguments to run the function. The argument
95+
`is_product` signals that the node is loaded as a product with a
9296
[pytask.Product](../api/utilities_and_typing.md#pytask.Product) annotation or via
9397
`produces`.
9498

9599
When the node is loaded as a dependency, we want to inject the value of the pickle
96100
file. In the other case, the node returns itself so users can call
97-
`pytask.PickleNode.save` themselves.
101+
[`pytask.PickleNode.save`](../api/nodes_and_tasks.md#pytask.PickleNode.save)
102+
themselves.
98103

99-
- `pytask.PickleNode.save` is called when a task function returns and allows to save the
100-
return values.
104+
- [`pytask.PickleNode.save`](../api/nodes_and_tasks.md#pytask.PickleNode.save) is called
105+
when a task function returns and allows to save the return values.
101106

102107
## Improvements
103108

104-
Usually, you would like your custom node to work with `pathlib.Path` objects and
105-
`upath.UPath` objects allowing to work with remote filesystems. To simplify getting the
106-
state of the node, you can use the `pytask.get_state_of_path` function.
109+
Usually, you would like your custom node to work with \[`pathlib.Path`\][] objects and
110+
\[`upath.UPath`\][] objects allowing to work with remote filesystems. To simplify
111+
getting the state of the node, you can use the
112+
[`pytask.get_state_of_path`](../api/utilities_and_typing.md#pytask.get_state_of_path)
113+
function.
107114

108115
## Conclusion
109116

docs/source/plugin_list.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Plugin List
22

3-
PyPI projects that match `pytask-*` are considered [plugins](glossary.md#plugin) and are
4-
listed automatically. Packages classified as inactive are excluded.
3+
PyPI projects that match `pytask-*` are considered plugins and are listed automatically.
4+
Packages classified as inactive are excluded.
55

66
!!! warning
77

docs/source/tutorials/defining_dependencies_products.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Let's revisit the task from the [previous tutorial](write_a_task.md) that we def
6666

6767
!!! tip
6868

69-
If you do not know about `pathlib` check out this guide by
69+
If you do not know about \[`pathlib`\][] check out this guide by
7070
[RealPython](https://realpython.com/python-pathlib/). The module is beneficial for
7171
handling paths conveniently and across platforms.
7272

@@ -83,8 +83,9 @@ we will define it in `task_plot_data.py`.
8383
To specify the task relies on `data.pkl`, add the path to the function signature with
8484
any argument name (here `path_to_data`).
8585

86-
pytask assumes that all function arguments that do not have a `pytask.Product`
87-
annotation are dependencies of the task.
86+
pytask assumes that all function arguments that do not have a
87+
[`pytask.Product`](../api/utilities_and_typing.md#pytask.Product) annotation are
88+
dependencies of the task.
8889

8990
```py hl_lines="12"
9091
--8<-- "docs_src/tutorials/defining_dependencies_products_dependencies_py310.py"

docs/source/tutorials/using_a_data_catalog.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ The following tabs show you how to use the data catalog given the interface you
8686

8787
Use `data_catalog["data"]` as an default argument to access the
8888
[`pytask.PickleNode`](../api/nodes_and_tasks.md#pytask.PickleNode) within the task. When
89-
you are done transforming your `pandas.DataFrame`, save it with
89+
you are done transforming your \[`pandas.DataFrame`\][], save it with
9090
[`pytask.PNode.save`](../api/nodes_and_tasks.md#pytask.PNode.save).
9191

9292
```py hl_lines="11 22" title="task_data_preparation.py"
@@ -97,7 +97,7 @@ The following tabs show you how to use the data catalog given the interface you
9797

9898
Use `data_catalog["data"]` as an default argument to access the
9999
[`pytask.PickleNode`](../api/nodes_and_tasks.md#pytask.PickleNode) within the task. When
100-
you are done transforming your `pandas.DataFrame`, save it with
100+
you are done transforming your \[`pandas.DataFrame`\][], save it with
101101
[`pytask.PNode.save`](../api/nodes_and_tasks.md#pytask.PNode.save).
102102

103103
```py hl_lines="7 17" title="task_data_preparation.py"
@@ -122,8 +122,7 @@ The following tabs show you how to use the data catalog given the interface you
122122

123123
Next, we will define the second task that consumes the data set from the previous task.
124124
Following one of the interfaces gives you immediate access to the
125-
[`pandas.DataFrame`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html)
126-
in the task without any additional line to load it.
125+
\[`pandas.DataFrame`\][] in the task without any additional line to load it.
127126

128127
```py hl_lines="13" title="task_plot_data.py"
129128
--8<-- "docs_src/tutorials/using_a_data_catalog_3_py310.py"
@@ -170,13 +169,13 @@ path means the location is relative to the module of the data catalog.
170169
--8<-- "docs_src/tutorials/using_a_data_catalog_4.py"
171170
```
172171

173-
You can now use the data catalog as in the previous example and use the `pathlib.Path`
174-
in the task.
172+
You can now use the data catalog as in the previous example and use the
173+
\[`pathlib.Path`\][] in the task.
175174

176175
!!! note
177176

178-
Note that the value of `data_catalog["csv"]` inside the task becomes a `pathlib.Path`.
179-
It is because a `pathlib.Path` in
177+
Note that the value of `data_catalog["csv"]` inside the task becomes a
178+
\[`pathlib.Path`\][]. It is because a \[`pathlib.Path`\][] in
180179
[`pytask.DataCatalog.add`](../api/core_classes_and_exceptions.md#pytask.DataCatalog.add)
181180
is not parsed to a [`pytask.PickleNode`](../api/nodes_and_tasks.md#pytask.PickleNode)
182181
but a [`pytask.PathNode`](../api/nodes_and_tasks.md#pytask.PathNode).
@@ -219,6 +218,6 @@ WindowsPath('C:\Users\pytask-dev\git\my_project\file.csv')
219218

220219
`data_catalog["data"]` was stored with a
221220
[`pytask.PickleNode`](../api/nodes_and_tasks.md#pytask.PickleNode) and returns the
222-
`pandas.DataFrame` whereas `data_catalog["csv"]` becomes a
221+
\[`pandas.DataFrame`\][] whereas `data_catalog["csv"]` becomes a
223222
[`pytask.PathNode`](../api/nodes_and_tasks.md#pytask.PathNode) and
224223
[`pytask.PNode.load`](../api/nodes_and_tasks.md#pytask.PNode.load) returns the path.

0 commit comments

Comments
 (0)