ipykernel-helper 0.0.43__tar.gz → 0.0.45__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: ipykernel-helper
3
- Version: 0.0.43
3
+ Version: 0.0.45
4
4
  Summary: Helpers for ipykernel and friends
5
5
  Author-email: Jeremy Howard <info@fast.ai>
6
6
  License: Apache-2.0
@@ -0,0 +1,2 @@
1
+ __version__ = "0.0.45"
2
+ from .core import *
@@ -49,6 +49,7 @@ d = { 'settings': { 'branch': 'main',
49
49
  'ipykernel_helper.core._param_idx': ('core.html#_param_idx', 'ipykernel_helper/core.py'),
50
50
  'ipykernel_helper.core._rank': ('core.html#_rank', 'ipykernel_helper/core.py'),
51
51
  'ipykernel_helper.core._safe_repr': ('core.html#_safe_repr', 'ipykernel_helper/core.py'),
52
+ 'ipykernel_helper.core._safe_sig': ('core.html#_safe_sig', 'ipykernel_helper/core.py'),
52
53
  'ipykernel_helper.core._signatures': ('core.html#_signatures', 'ipykernel_helper/core.py'),
53
54
  'ipykernel_helper.core.fix_editable_priority': ( 'core.html#fix_editable_priority',
54
55
  'ipykernel_helper/core.py'),
@@ -50,6 +50,10 @@ def _safe_repr(obj, max_len=200):
50
50
  except Exception as e: return f"<repr error: {str(e)}>"
51
51
 
52
52
  # %% ../nbs/00_core.ipynb #1e600ee2
53
+ def _safe_sig(v):
54
+ try: return str(signature(v))
55
+ except Exception: return '(...)'
56
+
53
57
  @patch
54
58
  def user_items(self:InteractiveShell, max_len=200, xtra_skip=()):
55
59
  "Get user-defined vars & funcs from namespace."
@@ -66,7 +70,7 @@ def user_items(self:InteractiveShell, max_len=200, xtra_skip=()):
66
70
  if not k in ignore and k not in nsh}
67
71
  user_vars = {k:_safe_repr(v, max_len=max_len)
68
72
  for k, v in user_items.items() if not k.startswith('_') and not isinstance(v, rm_types)}
69
- user_fns = {k:str(signature(v)) for k, v in user_items.items()
73
+ user_fns = {k:_safe_sig(v) for k, v in user_items.items()
70
74
  if isinstance(v, FunctionType) and v.__module__ == '__main__' and not k.startswith('__')}
71
75
  return user_vars,user_fns
72
76
 
@@ -395,7 +399,7 @@ async def run_cell_magic(self:InteractiveShell, magic_name, line, cell):
395
399
  return result
396
400
 
397
401
  def _await_cell_magic(lines):
398
- if lines and 'get_ipython().run_cell_magic(' in lines[0]: lines = ['await ' + lines[0]] + lines[1:]
402
+ if lines and 'get_ipython().run_cell_magic(' in lines[0] and 'await ' not in lines[0]: lines = ['await ' + lines[0]] + lines[1:]
399
403
  return lines
400
404
 
401
405
  def load_ipython_extension(ip):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ipykernel-helper
3
- Version: 0.0.43
3
+ Version: 0.0.45
4
4
  Summary: Helpers for ipykernel and friends
5
5
  Author-email: Jeremy Howard <info@fast.ai>
6
6
  License: Apache-2.0
@@ -28,4 +28,6 @@ version = {attr = "ipykernel_helper.__version__"}
28
28
  include = ["ipykernel_helper"]
29
29
 
30
30
  [tool.nbdev]
31
+ allowed_metadata_keys = ['solveit_dialog_mode', 'solveit_ver']
32
+ allowed_cell_metadata_keys = ["solveit_ai"]
31
33
  custom_sidebar = false
@@ -1,2 +0,0 @@
1
- __version__ = "0.0.43"
2
- from .core import *