Skip to content

Commit be9aaf1

Browse files
committed
Preserve autodoc shortcut links in docs
1 parent 792570c commit be9aaf1

9 files changed

Lines changed: 31 additions & 26 deletions

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ repos:
5353
mdformat-pyproject>=0.0.2,
5454
]
5555
files: (docs/.)
56-
exclude: (docs/source/reference_guides/hookspecs\.md|docs/source/api/.*\.md)
56+
exclude: (docs/source/reference_guides/hookspecs\.md|docs/source/api/.*\.md|docs/source/how_to_guides/capture_warnings\.md|docs/source/how_to_guides/hashing_inputs_of_tasks\.md|docs/source/how_to_guides/provisional_nodes_and_task_generators\.md|docs/source/how_to_guides/remote_files\.md|docs/source/how_to_guides/writing_custom_nodes\.md|docs/source/tutorials/defining_dependencies_products\.md|docs/source/tutorials/using_a_data_catalog\.md)
5757
- repo: https://github.com/kynan/nbstripout
5858
rev: 0.9.1
5959
hooks:

docs/source/how_to_guides/capture_warnings.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ 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. \[`pandas.errors.SettingWithCopyWarning`\][]
66-
though needs to be imported from \[`pandas.errors`\][].
65+
built-in warning with no module specified.
66+
[`pandas.errors.SettingWithCopyWarning`][] though needs to be imported from
67+
[`pandas.errors`][].
6768

6869
## Disabling warnings summary
6970

docs/source/how_to_guides/hashing_inputs_of_tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Hashing inputs of tasks
22

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

docs/source/how_to_guides/provisional_nodes_and_task_generators.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ 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`\][]
39-
object inside the function, which allows us to store the files.
38+
as a product annotation, we get access to the `root_dir` as a
39+
[`pathlib.Path`][] object inside the function, which allows us to store
40+
the files.
4041

4142
!!! note
4243

docs/source/how_to_guides/remote_files.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ 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
12-
easy to interact with files from an HTTP(S)-, Dropbox-, S3-, GCP-, Azure-based
11+
with remote files. The package provides a [`pathlib`][]-like interface, making
12+
it very easy to interact with files from an HTTP(S)-, Dropbox-, S3-, GCP-, Azure-based
1313
filesystem, and many more.
1414

1515
## HTTP(S)-based filesystem

docs/source/how_to_guides/writing_custom_nodes.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +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
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`\][].
14+
A typical task operation is to load data like a [`pandas.DataFrame`][]
15+
from a pickle file, transform it, and store it on disk. The usual way would be to use
16+
paths to point to inputs and outputs and call [`pandas.read_pickle`][] and
17+
[`pandas.DataFrame.to_pickle`][].
1818

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

27-
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
28+
the type hint.
2829

2930
The result will be the following task.
3031

@@ -106,9 +107,9 @@ Here are some explanations.
106107

107108
## Improvements
108109

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
110+
Usually, you would like your custom node to work with [`pathlib.Path`][] objects and
111+
[`upath.UPath`][] objects allowing to work with remote
112+
filesystems. To simplify getting the state of the node, you can use the
112113
[`pytask.get_state_of_path`](../api/utilities_and_typing.md#pytask.get_state_of_path)
113114
function.
114115

docs/source/tutorials/defining_dependencies_products.md

Lines changed: 1 addition & 1 deletion
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

docs/source/tutorials/using_a_data_catalog.md

Lines changed: 7 additions & 6 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,7 +122,8 @@ 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`\][] in the task without any additional line to load it.
125+
[`pandas.DataFrame`][] in the task without any additional line to load
126+
it.
126127

127128
```py hl_lines="13" title="task_plot_data.py"
128129
--8<-- "docs_src/tutorials/using_a_data_catalog_3_py310.py"
@@ -170,12 +171,12 @@ path means the location is relative to the module of the data catalog.
170171
```
171172

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

175176
!!! note
176177

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

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

docs/source/type_hints.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ information on the type of variables.
66
Type hints can be used
77

88
- by editors to provide better introspection into objects.
9-
- by tools like \[`mypy`\][] and [ty](https://github.com/astral-sh/ty) from Astral that
10-
check your code given the variable types.
9+
- by tools like [`mypy`](https://mypy-lang.org/) and
10+
[ty](https://github.com/astral-sh/ty) from Astral that check your code given the
11+
variable types.
1112
- as additional documentation.
1213

1314
pytask uses type hints as part of its interface.

0 commit comments

Comments
 (0)