conkernelclient 0.0.17__tar.gz → 0.0.18__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: conkernelclient
3
- Version: 0.0.17
3
+ Version: 0.0.18
4
4
  Summary: Concurrent-safe Jupyter KernelClient
5
5
  Author-email: Jeremy Howard <github@jhoward.fastmail.fm>
6
6
  License: Apache-2.0
@@ -14,7 +14,7 @@ Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: jupyter_client
16
16
  Requires-Dist: fastcore>=2.1.17
17
- Requires-Dist: jupywire>=0.0.1
17
+ Requires-Dist: jupywire>=0.1.4
18
18
  Provides-Extra: dev
19
19
  Requires-Dist: ipykernel; extra == "dev"
20
20
  Requires-Dist: ipymini>=0.1.17; extra == "dev"
@@ -1,3 +1,3 @@
1
- __version__ = "0.0.17"
1
+ __version__ = "0.0.18"
2
2
  from .core import *
3
3
  from .ops import *
@@ -71,10 +71,8 @@ d = { 'settings': { 'branch': 'main',
71
71
  'conkernelclient.ops._ReqProxy.__getattr__': ( 'ops.html#_reqproxy.__getattr__',
72
72
  'conkernelclient/ops.py'),
73
73
  'conkernelclient.ops._ReqProxy.__init__': ('ops.html#_reqproxy.__init__', 'conkernelclient/ops.py'),
74
- 'conkernelclient.ops.iopub_msgs': ('ops.html#iopub_msgs', 'conkernelclient/ops.py'),
75
74
  'conkernelclient.ops.iopub_streams': ('ops.html#iopub_streams', 'conkernelclient/ops.py'),
76
75
  'conkernelclient.ops.iter_timeout': ('ops.html#iter_timeout', 'conkernelclient/ops.py'),
77
- 'conkernelclient.ops.parent_id': ('ops.html#parent_id', 'conkernelclient/ops.py'),
78
76
  'conkernelclient.ops.parse_expr': ('ops.html#parse_expr', 'conkernelclient/ops.py'),
79
77
  'conkernelclient.ops.reconnect': ('ops.html#reconnect', 'conkernelclient/ops.py'),
80
78
  'conkernelclient.ops.run_kernel': ('ops.html#run_kernel', 'conkernelclient/ops.py')}}}
@@ -5,14 +5,16 @@ Docs: https://AnswerDotAI.github.io/conkernelclient/ops.html.md"""
5
5
  # AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/01_ops.ipynb.
6
6
 
7
7
  # %% auto #0
8
- __all__ = ['default_timeout', 'output_types', 'parent_id', 'iter_timeout', 'iopub_msgs', 'iopub_streams', 'EvalError',
9
- 'parse_expr', 'run_kernel', 'reconnect']
8
+ __all__ = ['default_timeout', 'iter_timeout', 'iopub_streams', 'EvalError', 'parse_expr', 'run_kernel', 'reconnect', 'parent_id',
9
+ 'iopub_msgs', 'output_types']
10
10
 
11
11
  # %% ../nbs/01_ops.ipynb #23936f1c
12
12
  from fastcore.utils import *
13
13
  from fastcore.ansi import strip_ansi
14
14
  from fastcore.nbio import msgs2outs, preferred_out
15
15
  from .core import ConKernelClient, ConKernelManager, DeadKernelError
16
+ from jupywire.ops import parent_id, iopub_msgs, output_types
17
+ _all_ = ['parent_id', 'iopub_msgs', 'output_types']
16
18
  from contextlib import asynccontextmanager
17
19
  from ast import literal_eval
18
20
  from queue import Empty
@@ -21,10 +23,6 @@ import asyncio, time
21
23
  # %% ../nbs/01_ops.ipynb #d62f6b51
22
24
  default_timeout = 10
23
25
 
24
- def parent_id(msg):
25
- "The `msg_id` of the request this `msg` responds to, or None"
26
- return nested_idx(msg, "parent_header", "msg_id") or None
27
-
28
26
  def iter_timeout(timeout=None, default=default_timeout):
29
27
  "Yield remaining seconds until `timeout` expires, using monotonic time"
30
28
  end = time.monotonic() + (timeout or default)
@@ -51,17 +49,7 @@ async def iopub_flush(self:ConKernelClient, timeout=0.1):
51
49
  while True: await self.get_iopub_msg(timeout=timeout)
52
50
  except Empty: pass
53
51
 
54
- # %% ../nbs/01_ops.ipynb #add288fe
55
- output_types = {'stream', 'execute_result', 'display_data', 'error'}
56
-
57
-
58
52
  # %% ../nbs/01_ops.ipynb #ebdbd6eb
59
- def iopub_msgs(msgs, msg_type=None):
60
- "Filter iopub `msgs` by `msg_type` - a single type, or a collection of types (all messages if None)"
61
- if msg_type is None: return msgs
62
- types = {msg_type} if isinstance(msg_type, str) else msg_type
63
- return [m for m in msgs if m['msg_type'] in types]
64
-
65
53
  def iopub_streams(msgs, name=None):
66
54
  "The stream messages in `msgs`, optionally only stream `name` ('stdout'/'stderr')"
67
55
  streams = iopub_msgs(msgs, 'stream')
@@ -116,11 +104,10 @@ def reply(self:ConKernelClient,
116
104
  code, # A string of code in the kernel's language.
117
105
  user_expressions:NoneType=None, # A dict mapping names to expressions to be evaluated in the user's dict
118
106
  allow_stdin:NoneType=None, # Flag for whether the kernel can send stdin requests to frontends.
119
- cts_typ:str='code', timeout:int=None, msg_id:NoneType=None, priority:bool=False, **kw
107
+ cts_typ:str='code', timeout:int=None, msg_id:NoneType=None, **kw
120
108
  ):
121
- if priority: assert self.priority, 'no priority subshell configured'
122
109
  return self.execute(code, user_expressions=user_expressions, allow_stdin=allow_stdin, reply=True,
123
- cts_typ=cts_typ, timeout=timeout or getattr(self, 'default_timeout', default_timeout), msg_id=msg_id, subsh_id=self.priority if priority else None, **kw)
110
+ cts_typ=cts_typ, timeout=timeout or getattr(self, 'default_timeout', default_timeout), msg_id=msg_id, **kw)
124
111
 
125
112
  # %% ../nbs/01_ops.ipynb #5de02acb
126
113
  from jupywire.ops import EvalOps, EvalException, try_eval
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: conkernelclient
3
- Version: 0.0.17
3
+ Version: 0.0.18
4
4
  Summary: Concurrent-safe Jupyter KernelClient
5
5
  Author-email: Jeremy Howard <github@jhoward.fastmail.fm>
6
6
  License: Apache-2.0
@@ -14,7 +14,7 @@ Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: jupyter_client
16
16
  Requires-Dist: fastcore>=2.1.17
17
- Requires-Dist: jupywire>=0.0.1
17
+ Requires-Dist: jupywire>=0.1.4
18
18
  Provides-Extra: dev
19
19
  Requires-Dist: ipykernel; extra == "dev"
20
20
  Requires-Dist: ipymini>=0.1.17; extra == "dev"
@@ -1,6 +1,6 @@
1
1
  jupyter_client
2
2
  fastcore>=2.1.17
3
- jupywire>=0.0.1
3
+ jupywire>=0.1.4
4
4
 
5
5
  [dev]
6
6
  ipykernel
@@ -18,7 +18,7 @@ classifiers = [
18
18
  dependencies = [
19
19
  'jupyter_client',
20
20
  'fastcore>=2.1.17',
21
- 'jupywire>=0.0.1',
21
+ 'jupywire>=0.1.4',
22
22
  ]
23
23
 
24
24
  [project.optional-dependencies]