Skip to content

Commit 3e33b68

Browse files
committed
Added all_concurrency_run_modes to Kernel.
Rename 'direct' to 'blocking' and improve some documentation. Print some message when suppressing the error; added a metatakey 'suppress_error_message'. Added a sleep(0) to _stop_on_error_time to clear any waiting messages.
1 parent 00f407b commit 3e33b68

26 files changed

+475
-251
lines changed

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,7 @@
1616
"tag:yaml.org,2002:python/name:material.extensions.emoji.twemoji",
1717
"tag:yaml.org,2002:python/name:pymdownx.superfences.fence_code_format",
1818
"tag:yaml.org,2002:python/object/apply:pymdownx.slugs.slugify mapping"
19-
]
19+
],
20+
"spellright.language": ["en"],
21+
"spellright.documentTypes": ["markdown", "latex", "plaintext", "python"]
2022
}

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ pytest -vv --cov
3030

3131
## Code Styling
3232

33-
`Async kernel` uses ruff for code formatting.
34-
the pre-commit hook should take care of how it should look.
35-
To install `pre-commit`, run the following::
33+
`Async kernel` uses ruff for code formatting. The pre-commit hook should take care of how it should look.
34+
35+
To install `pre-commit`, run the following:
3636

3737
```shell
3838
pip install pre-commit
3939
pre-commit install
4040
```
4141

42-
You can invoke the pre-commit hook by hand at any time with::
42+
You can invoke the pre-commit hook by hand at any time with:
4343

4444
```shell
4545
pre-commit run

README.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,10 @@ Async kernel is a Python [Jupyter kernel](https://docs.jupyter.org/en/latest/pro
1010

1111
## Highlights
1212

13-
- Asynchronous
14-
- Comms is not blocked during cell execution[^non-blocking-execution]
15-
- Concurrent code execution [^run-concurrent]
13+
- Concurrent message handling
1614
- [Debugger client](https://jupyterlab.readthedocs.io/en/latest/user/debugger.html#debugger)
1715
- Configurable backend - "asyncio" (default) or "trio backend" [^config-backend]
1816
- [IPython](https://pypi.org/project/ipython/) shell for magic, code completions, and history
19-
- No tornado - instead using anyio's [`wait_readable`](https://anyio.readthedocs.io/en/stable/api.html#anyio.wait_readable) to wait for incoming messages on zmq sockets
2017

2118
## Installation
2219

@@ -38,13 +35,4 @@ async-kernel -a async-trio
3835

3936
[![Link to demo](https://github.com/user-attachments/assets/9a4935ba-6af8-4c9f-bc67-b256be368811)](https://fleming79.github.io/async-kernel/simple_example/ "Show demo notebook.")
4037

41-
[^non-blocking-execution]: Shell messaging runs in a task separate to execute requests in the main thread. This means shell messages (including comms) can pass freely whilst an execute request is busy awaiting a result.
42-
43-
[^run-concurrent]: Code can also be scheduled for concurrent execution by adding `##task` or `##thread` at the top of the cell.
44-
45-
Works with concurrent cell execution
46-
47-
- [x] Jupyterlab
48-
- [ ] VS code - runs one cell at a time
49-
5038
[^config-backend]: The default backend is 'asyncio'. To add a 'trio' backend, define a KernelSpec with a kernel name that includes trio in it.

docs/about/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: About
3+
description: Notes about contributing, changelog and development.
4+
icon:
5+
# subtitle: A sub title
6+
---

docs/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
---
2+
title: Reference
3+
description: Readme.
4+
icon: material/home
5+
---
6+
17
--8<-- "README.md"

docs/notebooks/index.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: Notebooks
3+
description: Example notebooks for async kernel.
4+
icon: material/note-text
5+
# subtitle: A sub title
6+
---
7+
8+
# Notebooks
9+
10+
Notebooks in this documentation show the result of each cell after executing for a short duration (~100ms).
11+
12+
You can download the notebook with the button at the top right of the page for the notebook.
13+
14+
!!! note
15+
16+
The [suppress-error][async_kernel.typing.Tags.suppress_error] tag is inserted in code cells to enable
17+
with generating documentation. The symbol '⚠' is an indicator that the error was suppressed. Normally
18+
this is due to the timeout but there is no distinction on the type of error.

docs/notebooks/overview.md

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

0 commit comments

Comments
 (0)