Skip to content

Commit aaa1af7

Browse files
committed
Move to markdown.
1 parent 523f005 commit aaa1af7

File tree

12 files changed

+198
-263
lines changed

12 files changed

+198
-263
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
---
1+
______________________________________________________________________
22

3-
name: Bug Report
4-
about: Create a bug report to help us improve pytask-parallel
5-
title: "BUG:"
6-
labels: "bug"
3+
name: Bug Report about: Create a bug report to help us improve pytask-parallel title:
4+
"BUG:" labels: "bug"
75

8-
---
6+
______________________________________________________________________
97

108
- [ ] I have checked that this issue has not already been reported.
119

@@ -14,11 +12,11 @@ labels: "bug"
1412
- [ ] (optional) I have confirmed this bug exists on the `main` branch of
1513
pytask-parallel.
1614

17-
---
15+
______________________________________________________________________
1816

19-
**Note**: Please read [this
20-
guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing
21-
how to provide the necessary information for us to reproduce your bug.
17+
**Note**: Please read
18+
[this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports)
19+
detailing how to provide the necessary information for us to reproduce your bug.
2220

2321
#### Code Sample, a copy-pastable example
2422

.github/ISSUE_TEMPLATE/documentation.md

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

3-
name: Documentation Improvement
4-
about: Report wrong or missing documentation
5-
title: "DOC:"
6-
labels: "documentation"
3+
name: Documentation Improvement about: Report wrong or missing documentation title:
4+
"DOC:" labels: "documentation"
75

8-
---
6+
______________________________________________________________________
97

108
#### Location of the documentation
119

.github/ISSUE_TEMPLATE/enhancement.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
---
1+
______________________________________________________________________
22

3-
name: Enhancement
4-
about: Suggest an idea for pytask-parallel
5-
title: "ENH:"
6-
labels: "enhancement"
3+
name: Enhancement about: Suggest an idea for pytask-parallel title: "ENH:" labels:
4+
"enhancement"
75

8-
---
6+
______________________________________________________________________
97

108
#### Is your feature request related to a problem?
119

1210
Provide a description of what the problem is, e.g. "I wish I could use pytask-parallel
13-
to do [...]".
11+
to do \[...\]".
1412

1513
#### Describe the solution you'd like
1614

.github/ISSUE_TEMPLATE/question.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
---
1+
______________________________________________________________________
22

3-
name: Submit Question
4-
about: Ask a general question about pytask-parallel
5-
title: "QST:"
3+
name: Submit Question about: Ask a general question about pytask-parallel title: "QST:"
64
labels: "question"
75

8-
---
6+
______________________________________________________________________
97

108
#### Question about pytask-parallel
119

12-
**Note**: If you'd still like to submit a question, please read [this guide](
13-
https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to
14-
provide the necessary information for us to reproduce your question.
10+
**Note**: If you'd still like to submit a question, please read
11+
[this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports)
12+
detailing how to provide the necessary information for us to reproduce your question.
1513

1614
```python
1715
# Your code here, if applicable

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ Provide a description and/or bullet points to describe the changes in this PR.
66

77
- [ ] Reference issues which can be closed due to this PR with "Closes #x".
88
- [ ] Review whether the documentation needs to be updated.
9-
- [ ] Document PR in docs/changes.rst.
9+
- [ ] Document PR in CHANGES.md.

.pre-commit-config.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ repos:
1616
- id: python-no-eval
1717
- id: python-no-log-warn
1818
- id: python-use-type-annotations
19-
- id: rst-backticks
20-
- id: rst-directive-colons
21-
- id: rst-inline-touching-normal
2219
- id: text-unicode-replacement-char
2320
- repo: https://github.com/asottile/pyupgrade
2421
rev: v2.32.0
@@ -64,20 +61,24 @@ repos:
6461
pydocstyle,
6562
Pygments,
6663
]
67-
- repo: https://github.com/PyCQA/doc8
68-
rev: 0.11.1
69-
hooks:
70-
- id: doc8
7164
- repo: https://github.com/econchick/interrogate
7265
rev: 1.5.0
7366
hooks:
7467
- id: interrogate
7568
args: [-v, --fail-under=40, src, tests]
69+
- repo: https://github.com/executablebooks/mdformat
70+
rev: 0.7.14
71+
hooks:
72+
- id: mdformat
73+
additional_dependencies: [
74+
mdformat-gfm,
75+
mdformat-black,
76+
]
77+
args: [--wrap, "88"]
7678
- repo: https://github.com/codespell-project/codespell
7779
rev: v2.1.0
7880
hooks:
7981
- id: codespell
80-
args: [-L unparseable]
8182
- repo: https://github.com/mgedmin/check-manifest
8283
rev: "0.48"
8384
hooks:

CHANGES.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Changes
2+
3+
This is a record of all past pytask-parallel releases and what went into them in reverse
4+
chronological order. Releases follow [semantic versioning](https://semver.org/) and all
5+
releases are available on [PyPI](https://pypi.org/project/pytask-parallel) and
6+
[Anaconda.org](https://anaconda.org/conda-forge/pytask-parallel).
7+
8+
## 0.1.2 - 2022-xx-xx
9+
10+
- {pull}`36` adds a test for <https://github.com/pytask-dev/pytask/issues/216>.
11+
12+
## 0.1.1 - 2022-02-08
13+
14+
- {pull}`30` removes unnecessary content from `tox.ini`.
15+
- {pull}`33` skips concurrent CI builds.
16+
- {pull}`34` deprecates Python 3.6 and adds support for Python 3.10.
17+
18+
## 0.1.0 - 2021-07-20
19+
20+
- {pull}`19` adds `conda-forge` to the `README.rst`.
21+
- {pull}`22` add note that the debugger cannot be used together with pytask-parallel.
22+
- {pull}`24` replaces versioneer with setuptools-scm.
23+
- {pull}`25` aborts build and prints reports on `KeyboardInterrupt`.
24+
- {pull}`27` enables rich tracebacks from subprocesses.
25+
26+
## 0.0.8 - 2021-03-05
27+
28+
- {pull}`17` fixes the unidentifiable version.
29+
30+
## 0.0.7 - 2021-03-04
31+
32+
- {pull}`14` fixes some post-release issues.
33+
- {pull}`16` add dependencies to `setup.py` and changes the default backend to `loky`.
34+
35+
## 0.0.6 - 2021-02-27
36+
37+
- {pull}`12` replaces all occurrences of `n_processes` with `n_workers`.
38+
- {pull}`13` adds a license, versioneer, and allows publishing on PyPI.
39+
40+
## 0.0.5 - 2020-12-28
41+
42+
- {pull}`5` fixes the CI and other smaller issues.
43+
- {pull}`8` aligns pytask-parallel with task priorities in pytask v0.0.11.
44+
- {pull}`9` enables --max-failures. Closes {issue}`7`.
45+
- {pull}`10` releases v0.0.5.
46+
47+
## 0.0.4 - 2020-10-30
48+
49+
- {pull}`4` implement an executor with `loky`.
50+
51+
## 0.0.3 - 2020-09-12
52+
53+
- {pull}`3` align the program with pytask v0.0.6.
54+
55+
## 0.0.2 - 2020-08-12
56+
57+
- {pull}`1` prepares the plugin for pytask v0.0.5.
58+
- {pull}`2` better parsing and callbacks.
59+
60+
## 0.0.1 - 2020-07-17
61+
62+
- Initial commit which combined the whole effort to release v0.0.1.

CHANGES.rst

Lines changed: 0 additions & 84 deletions
This file was deleted.

MANIFEST.in

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
prune tests
22

3-
exclude *.rst
3+
exclude *.md
44
exclude *.yaml
55
exclude *.yml
66
exclude tox.ini
77

8-
include README.rst
8+
include README.md
99
include LICENSE
10-
include versioneer.py
11-
include src/pytask_parallel/_version.py

README.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# pytask-parallel
2+
3+
[![PyPI](https://img.shields.io/pypi/v/pytask-parallel?color=blue)](https://pypi.org/project/pytask-parallel)
4+
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pytask-parallel)](https://pypi.org/project/pytask-parallel)
5+
[![image](https://img.shields.io/conda/vn/conda-forge/pytask-parallel.svg)](https://anaconda.org/conda-forge/pytask-parallel)
6+
[![image](https://img.shields.io/conda/pn/conda-forge/pytask-parallel.svg)](https://anaconda.org/conda-forge/pytask-parallel)
7+
[![PyPI - License](https://img.shields.io/pypi/l/pytask-parallel)](https://pypi.org/project/pytask-parallel)
8+
[![image](https://img.shields.io/github/workflow/status/pytask-dev/pytask-parallel/Continuous%20Integration%20Workflow/main)](https://github.com/pytask-dev/pytask-parallel/actions?query=branch%3Amain)
9+
[![image](https://codecov.io/gh/pytask-dev/pytask-parallel/branch/main/graph/badge.svg)](https://codecov.io/gh/pytask-dev/pytask-parallel)
10+
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/pytask-dev/pytask-parallel/main.svg)](https://results.pre-commit.ci/latest/github/pytask-dev/pytask-parallel/main)
11+
[![image](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
12+
13+
______________________________________________________________________
14+
15+
Parallelize the execution of tasks with `pytask-parallel` which is a plugin for
16+
[pytask](https://github.com/pytask-dev/pytask).
17+
18+
## Installation
19+
20+
pytask-parallel is available on [PyPI](https://pypi.org/project/pytask-parallel) and
21+
[Anaconda.org](https://anaconda.org/conda-forge/pytask-parallel). Install it with
22+
23+
```console
24+
$ pip install pytask-parallel
25+
26+
# or
27+
28+
$ conda install -c conda-forge pytask-parallel
29+
```
30+
31+
By default, the plugin uses `loky`'s robust implementation of the `ProcessPoolExecutor`.
32+
33+
It is also possible to select the `ProcessPoolExecutor` or `ThreadPoolExecutor` from the
34+
[concurrent.futures](https://docs.python.org/3/library/concurrent.futures.html) module
35+
as backends to execute tasks asynchronously.
36+
37+
## Usage
38+
39+
To parallelize your tasks across many workers, pass an integer greater than 1 or
40+
`'auto'` to the command-line interface.
41+
42+
```console
43+
$ pytask -n 2
44+
$ pytask --n-workers 2
45+
46+
# Starts os.cpu_count() - 1 workers.
47+
$ pytask -n auto
48+
```
49+
50+
Using processes to parallelize the execution of tasks is useful for CPU bound tasks such
51+
as numerical computations. ([Here](https://stackoverflow.com/a/868577/7523785) is an
52+
explanation on what CPU or IO bound means.)
53+
54+
For IO bound tasks, tasks where the limiting factor are network responses, access to
55+
files, you can parallelize via threads.
56+
57+
```console
58+
$ pytask --parallel-backend threads
59+
```
60+
61+
You can also set the options in one of the configuration files (`pytask.ini`, `tox.ini`,
62+
or `setup.cfg`).
63+
64+
```ini
65+
# This is the default configuration. Note that, parallelization is turned off.
66+
67+
[pytask]
68+
n_workers = 1
69+
parallel_backend = loky # or processes or threads
70+
```
71+
72+
## Warning
73+
74+
It is not possible to combine parallelization with debugging. That is why `--pdb` or
75+
`--trace` deactivate parallelization.
76+
77+
If you parallelize the execution of your tasks using two or more workers, do not use
78+
`breakpoint()` or `import pdb; pdb.set_trace()` since both will cause exceptions.
79+
80+
## Changes
81+
82+
Consult the [release notes](CHANGES.md) to find out about what is new.
83+
84+
## Development
85+
86+
- `pytask-parallel` does not call the `pytask_execute_task_protocol` hook
87+
specification/entry-point because `pytask_execute_task_setup` and
88+
`pytask_execute_task` need to be separated from `pytask_execute_task_teardown`. Thus,
89+
plugins which change this hook specification may not interact well with the
90+
parallelization.
91+
92+
- There are two PRs for CPython which try to re-enable setting custom reducers which
93+
should have been working, but does not. Here are the references.
94+
95+
> - <https://bugs.python.org/issue28053>
96+
> - <https://github.com/python/cpython/pull/9959>
97+
> - <https://github.com/python/cpython/pull/15058>

0 commit comments

Comments
 (0)