Skip to content

Commit 609304a

Browse files
authored
Spell and grammar checking for some tutorials. (#279)
1 parent a8d9e8a commit 609304a

13 files changed

+97
-104
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ______________________________________________________________________
2121

2222
<!-- Keep in sync with docs/source/index.md -->
2323

24-
pytask is a workflow management system which facilitates reproducible data analyses. Its
24+
pytask is a workflow management system that facilitates reproducible data analyses. Its
2525
features include:
2626

2727
- **Automatic discovery of tasks.**
@@ -73,7 +73,7 @@ template or start from
7373

7474
# Usage
7575

76-
A task is a function which is detected if the module and the function name are prefixed
76+
A task is a function that is detected if the module and the function name are prefixed
7777
with `task_`. Here is an example.
7878

7979
```python
@@ -89,20 +89,20 @@ def task_hello_earth(produces):
8989

9090
Here are some details:
9191

92-
- Dependencies and products of a task are tracked via markers. For dependencies use
93-
`@pytask.mark.depends_on` and for products use `@pytask.mark.produces`. Use strings
94-
and `pathlib.Path` to specify the location.
95-
- Use `produces` (and `depends_on`) as function arguments to access the paths of the
96-
dependencies and products inside the function. All values are converted to
97-
`pathlib.Path`'s. Here, `produces` holds the path to `"hello_earth.txt"`.
92+
- Dependencies and products of a task are tracked via markers. Use
93+
`@pytask.mark.depends_on` for dependencies and `@pytask.mark.produces` for products.
94+
Values are strings or `pathlib.Path` and point to files on the disk.
95+
- Use `produces` (and `depends_on`) as function arguments to access the paths inside the
96+
function. pytask converts all paths to `pathlib.Path`'s. Here, `produces` holds the
97+
path to `"hello_earth.txt"`.
9898

9999
To execute the task, enter `pytask` on the command-line
100100

101101
![image](https://github.com/pytask-dev/pytask/raw/main/docs/source/_static/images/readme.svg)
102102

103103
# Documentation
104104

105-
The documentation can be found under <https://pytask-dev.readthedocs.io/en/stable> with
105+
You find the documentation <https://pytask-dev.readthedocs.io/en/stable> with
106106
[tutorials](https://pytask-dev.readthedocs.io/en/stable/tutorials/index.html) and guides
107107
for
108108
[best practices](https://pytask-dev.readthedocs.io/en/stable/how_to_guides/index.html).
@@ -121,12 +121,12 @@ pytask is distributed under the terms of the [MIT license](LICENSE).
121121
The license also includes a copyright and permission notice from
122122
[pytest](https://github.com/pytest-dev/pytest) since some modules, classes, and
123123
functions are copied from pytest. Not to mention how pytest has inspired the development
124-
of pytask in general. Without the amazing work of
124+
of pytask in general. Without the excellent work of
125125
[Holger Krekel](https://github.com/hpk42) and pytest's many contributors, this project
126126
would not have been possible. Thank you!
127127

128-
pytask ows its beautiful appearance on the command line to
129-
[rich](https://github.com/Textualize/rich) written by
128+
pytask owes its beautiful appearance on the command line to
129+
[rich](https://github.com/Textualize/rich), written by
130130
[Will McGugan](https://github.com/willmcgugan).
131131

132132
Repeating tasks in loops is inspired by [ward](https://github.com/darrenburns/ward)
@@ -135,7 +135,7 @@ written by [Darren Burns](https://github.com/darrenburns).
135135
# Citation
136136

137137
If you rely on pytask to manage your research project, please cite it with the following
138-
key to help others to discover the tool.
138+
key to helping others to discover the tool.
139139

140140
```bibtex
141141
@Unpublished{Raabe2020,

docs/source/explanations/comparison_to_other_tools.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,7 @@ Cons
122122
General
123123

124124
- A general task-runner with task defined in yaml files.
125+
126+
## [zenml](https://github.com/zenml-io/zenml)
127+
128+
## [flyte](https://github.com/flyteorg/flyte)

docs/source/tutorials/capturing_output.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Capturing output
22

33
What is capturing? Some of your tasks may use {func}`print` statements, have progress
4-
bars, require user input or the libraries you are using show information during
4+
bars, require user input, or the libraries you are using show information during
55
execution.
66

77
Since the output would pollute the terminal and the information shown by pytask, it
@@ -13,15 +13,15 @@ the error.
1313

1414
## Default stdout/stderr/stdin capturing behavior
1515

16-
During task execution any output sent to `stdout` and `stderr` is captured. If a task
17-
fails its captured output will usually be shown along with the failure traceback.
16+
Any output sent to `stdout` and `stderr` is captured during task execution. pytask
17+
displays it only if the task fails in addition to the traceback.
1818

1919
In addition, `stdin` is set to a "null" object which will fail on attempts to read from
2020
it because it is rarely desired to wait for interactive input when running automated
2121
tasks.
2222

23-
By default capturing is done by intercepting writes to low level file descriptors. This
24-
allows to capture output from simple {func}`print` statements as well as output from a
23+
By default, capturing is done by intercepting writes to low-level file descriptors. This
24+
allows capturing output from simple {func}`print` statements as well as output from a
2525
subprocess started by a task.
2626

2727
## Setting capturing methods or disabling capturing

docs/source/tutorials/cleaning_projects.md

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

33
Projects usually become cluttered with obsolete files after some time.
44

5-
To clean the project from files which are not recognized by pytask and type
5+
To clean the project, type `pytask clean`
66

77
```{image} /_static/images/clean-dry-run.svg
88
```
99

10-
pytask performs a dry-run by default and shows all the files which can be removed.
10+
pytask performs a dry-run by default and lists all removable files.
1111

1212
If you want to remove the files, use {option}`pytask clean --mode` with one of the
1313
following modes.
@@ -16,23 +16,22 @@ following modes.
1616
- `interactive` allows you to decide for every file whether to keep it or not.
1717

1818
If you want to delete complete folders instead of single files, use
19-
{option}`pytask clean --directories`. If all content in a directory can be removed, only
20-
the directory is shown.
19+
{option}`pytask clean --directories`.
2120

2221
```{image} /_static/images/clean-dry-run-directories.svg
2322
```
2423

2524
## Excluding files
2625

27-
Files which are under version control with git are excluded from the cleaning process.
26+
pytask excludes files that are under version control with git.
2827

29-
If other files or directories should be excluded as well, you can use the
30-
{option}`pytask clean --exclude` option or the `exclude` key in the configuration file.
28+
Use the {option}`pytask clean --exclude` option or the `exclude` key in the
29+
configuration file to exclude files and directories.
3130

32-
The value can be a Unix filename pattern which is documented in {mod}`fnmatch` and
33-
supports the wildcard character `*` for any characters and other symbols.
31+
Values can be Unix filename patterns that, for example, support the wildcard character
32+
`*` for any characters. You find the documentation in {mod}`fnmatch`.
3433

35-
Here is an example where the `obsolete_folder` is excluded from the cleaning process.
34+
Here is an example for excluding a folder.
3635

3736
```console
3837
$ pytask clean --exclude obsolete_folder

docs/source/tutorials/collecting_tasks.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Collecting tasks
22

3-
If you want to inspect your project and see a summary of all the tasks in the projects,
4-
you can use the `pytask collect` command.
3+
If you want to inspect your project and see a summary of all the tasks, you can use the
4+
`pytask collect` command.
55

6-
For example, let us take the following task
6+
Let us take the following task.
77

88
```python
99
# Content of task_module.py
@@ -22,13 +22,13 @@ Now, running `pytask collect` will produce the following output.
2222
```{image} /_static/images/collect.svg
2323
```
2424

25-
If you want to have more information regarding dependencies and products of the task,
26-
append the {option}`pytask collect --nodes` flag.
25+
If you want to have more information regarding the dependencies and products of the
26+
task, append the {option}`pytask collect --nodes` flag.
2727

2828
```{image} /_static/images/collect-nodes.svg
2929
```
3030

31-
To restrict the set of tasks you are looking at, use markers, expression and ignore
31+
To restrict the set of tasks you are looking at, use markers, expressions and ignore
3232
patterns as usual.
3333

3434
## Further reading

docs/source/tutorials/configuration.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
pytask can be configured via the command-line interface or permanently with a
44
`pyproject.toml` file.
55

6-
The file also indicates the root of your project where pytask stores information on
7-
whether tasks need to be executed or not in a `.pytask.sqlite3` database.
6+
The file also indicates the root of your project where pytask stores information in a
7+
`.pytask.sqlite3` database.
88

99
:::{important}
1010
`pytask.ini`, `tox.ini`, and `setup.cfg` will be deprecated as configuration files for
@@ -15,8 +15,8 @@ your configuration in the `toml` format to facilitate the transition.
1515

1616
## The configuration file
1717

18-
You only need to add the header to the configuration file if you want to indicate the
19-
root of your project.
18+
You only need to add the header to the configuration file to indicate the root of your
19+
project.
2020

2121
```toml
2222
[tool.pytask.ini_options]
@@ -47,9 +47,9 @@ The second option is to let pytask try to find the configuration itself.
4747
1. Find the common base directory of all paths passed to pytask (default to the current
4848
working directory).
4949
2. Starting from this directory, look at all parent directories, and return the file if
50-
it is found.
51-
3. If a directory contains a `.git` directory/file, a `.hg` directory or a valid
52-
configuration file with the right section stop searching.
50+
it exists.
51+
3. If a directory contains a `.git` directory/file, a `.hg` directory, or a valid
52+
configuration file with the right section, stop searching.
5353

5454
## The options
5555

docs/source/tutorials/debugging.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ find out the cause of the exception.
1212
```{image} /_static/images/pdb.svg
1313
```
1414

15-
A following tutorial explains {doc}`how to select a subset of tasks <selecting_tasks>`.
16-
Combine it with the {option}`pytask build --pdb` flag to debug specific tasks.
15+
One tutorial explains {doc}`how to select a subset of tasks <selecting_tasks>`. Combine
16+
it with the {option}`pytask build --pdb` flag to debug specific tasks.
1717

1818
## Tracing
1919

docs/source/tutorials/defining_dependencies_products.md

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Defining dependencies and products
22

3-
To ensure pytask executes all tasks in a correct order, define which dependencies are
3+
To ensure pytask executes all tasks in correct order, define which dependencies are
44
required and which products are produced by a task.
55

66
:::{important}
7-
If you do not specify dependencies and products as explained below, pytask will not able
7+
If you do not specify dependencies and products as explained below, pytask will not be able
88
to build a graph, a {term}`DAG`, and will not be able to execute all tasks in the
99
project correctly!
1010
:::
@@ -27,13 +27,12 @@ Optionally, you can use `produces` as an argument of the task function and get a
2727
the same path inside the task function.
2828

2929
:::{tip}
30-
If you do not know about {mod}`pathlib` check out [^id3] and [^id4]. The module is very
31-
useful to handle paths conveniently and across platforms.
30+
If you do not know about {mod}`pathlib` check out [^id3] and [^id4]. The module is beneficial for handling paths conveniently and across platforms.
3231
:::
3332

3433
## Dependencies
3534

36-
Most tasks have dependencies. Similar to products, you can use the
35+
Most tasks have dependencies. Like products, you can use the
3736
{func}`@pytask.mark.depends_on <pytask.mark.depends_on>` marker to attach a
3837
dependency to a task.
3938

@@ -45,7 +44,7 @@ def task_plot_data(depends_on, produces):
4544
...
4645
```
4746

48-
Use `depends_on` as a function argument to work with the path of the dependency and, for
47+
Use `depends_on` as a function argument to work with the dependency path and, for
4948
example, load the data.
5049

5150
## Conversion
@@ -63,14 +62,13 @@ def task_create_random_data(produces):
6362
```
6463

6564
If you use `depends_on` or `produces` as arguments for the task function, you will have
66-
access to the paths of the targets as {class}`pathlib.Path` even if strings were used
67-
before.
65+
access to the paths of the targets as {class}`pathlib.Path`.
6866

6967
## Multiple dependencies and products
7068

71-
Most tasks have multiple dependencies or products. The easiest way to attach multiple
72-
dependencies or products to a task is to pass a {class}`dict` (highly recommended),
73-
{class}`list` or another iterator to the marker containing the paths.
69+
The easiest way to attach multiple dependencies or products to a task is to pass a
70+
{class}`dict` (highly recommended), {class}`list` or another iterator to the marker
71+
containing the paths.
7472

7573
To assign labels to dependencies or products, pass a dictionary. For example,
7674

@@ -108,19 +106,16 @@ keys are the positions in the list.
108106
{0: BLD / "data_0.pkl", 1: BLD / "data_1.pkl"}
109107
```
110108

111-
Why does pytask recommend dictionaries and even converts lists, tuples or other
109+
Why does pytask recommend dictionaries and convert lists, tuples, or other
112110
iterators to dictionaries? First, dictionaries with positions as keys behave very
113-
similar to lists.
111+
similarly to lists.
114112

115-
Secondly, dictionaries use keys instead of positions which is more verbose and
116-
descriptive and does not assume a fixed ordering. Both attributes are especially
117-
desirable in complex projects.
113+
Secondly, dictionaries use keys instead of positions that are more verbose and descriptive and do not assume a fixed ordering. Both attributes are especially desirable in complex projects.
118114

119115
## Multiple decorators
120116

121-
You can also attach multiple decorators to a function which will be merged into a single
122-
dictionary. This might help you to group certain dependencies and apply them to multiple
123-
tasks.
117+
pytask merges multiple decorators of one kind into a single dictionary. This might help
118+
you to group dependencies and apply them to multiple tasks.
124119

125120
```python
126121
common_dependencies = pytask.mark.depends_on(
@@ -143,12 +138,12 @@ Inside the task, `depends_on` will be
143138

144139
## Nested dependencies and products
145140

146-
Dependencies and products are allowed to be nested containers consisting of tuples,
147-
lists, and dictionaries. It beneficial if you want more structure and nesting.
141+
Dependencies and products can be nested containers consisting of tuples, lists, and
142+
dictionaries. It is beneficial if you want more structure and nesting.
148143

149-
Here is an example with a task which fits some model on data. It depends on a module
150-
containing the code for the model which is not actively used, but ensures that the task
151-
is rerun when the model is changed. And, it depends on data.
144+
Here is an example with a task that fits some model on data. It depends on a module
145+
containing the code for the model, which is not actively used but ensures that the task
146+
is rerun when the model is changed. And it depends on data.
152147

153148
```python
154149
@pytask.mark.depends_on(

docs/source/tutorials/invoking_pytask.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Invoking pytask
22

3-
pytask is a command line program which can be invoked with
3+
You can invoke pytask on the command line with
44

55
```console
66
$ pytask
@@ -15,7 +15,7 @@ $ pytask -h | --help
1515

1616
## Commands
1717

18-
pytask has multiple commands which are listed in the main help page.
18+
pytask has multiple commands that are listed in the main help page.
1919

2020
```{image} /_static/images/help_page.svg
2121
```
@@ -38,7 +38,7 @@ $ pytask <command-name> --help
3838
## The build command
3939

4040
The build command accepts among many options paths as positional arguments. If no paths
41-
are passed to the command line interface, pytask will look for the `paths` key in the
41+
are passed via the command line interface, pytask will look for the `paths` key in the
4242
configuration file. At last, pytask will collect tasks from the current working
4343
directory and subsequent folders.
4444

@@ -55,7 +55,7 @@ might run your tasks with missing or outdated dependencies.
5555

5656
## Options
5757

58-
Here are some useful options for the build command.
58+
Here are some valuable options for the build command.
5959

6060
### Showing errors immediately
6161

@@ -65,12 +65,12 @@ To show errors immediately when they occur, use
6565
$ pytask --show-errors-immediately
6666
```
6767

68-
It can be useful when you have a long-running workflow, but want feedback as soon as it
68+
It can be helpful when you have a long-running workflow but want feedback as soon as it
6969
is available.
7070

7171
### Stopping after the first (N) failures
7272

73-
To stop the build of the project after the first (N) failures use
73+
To stop the build of the project after the first `n` failures use
7474

7575
```console
7676
$ pytask -x | --stop-after-first-failure # Stop after the first failure

0 commit comments

Comments
 (0)