##// END OF EJS Templates
DOC: Some more autoformatting of docstrings....
Matthias Bussonnier -
Show More
@@ -68,20 +68,19 b' version_info = release.version_info'
68
68
69 def embed_kernel(module=None, local_ns=None, **kwargs):
69 def embed_kernel(module=None, local_ns=None, **kwargs):
70 """Embed and start an IPython kernel in a given scope.
70 """Embed and start an IPython kernel in a given scope.
71
71
72 If you don't want the kernel to initialize the namespace
72 If you don't want the kernel to initialize the namespace
73 from the scope of the surrounding function,
73 from the scope of the surrounding function,
74 and/or you want to load full IPython configuration,
74 and/or you want to load full IPython configuration,
75 you probably want `IPython.start_kernel()` instead.
75 you probably want `IPython.start_kernel()` instead.
76
76
77 Parameters
77 Parameters
78 ----------
78 ----------
79 module : types.ModuleType, optional
79 module : types.ModuleType, optional
80 The module to load into IPython globals (default: caller)
80 The module to load into IPython globals (default: caller)
81 local_ns : dict, optional
81 local_ns : dict, optional
82 The namespace to load into IPython user namespace (default: caller)
82 The namespace to load into IPython user namespace (default: caller)
83
83 **kwargs : various, optional
84 kwargs : various, optional
85 Further keyword args are relayed to the IPKernelApp constructor,
84 Further keyword args are relayed to the IPKernelApp constructor,
86 allowing configuration of the Kernel. Will only have an effect
85 allowing configuration of the Kernel. Will only have an effect
87 on the first embed_kernel call for a given process.
86 on the first embed_kernel call for a given process.
@@ -99,26 +98,25 b' def embed_kernel(module=None, local_ns=None, **kwargs):'
99
98
100 def start_ipython(argv=None, **kwargs):
99 def start_ipython(argv=None, **kwargs):
101 """Launch a normal IPython instance (as opposed to embedded)
100 """Launch a normal IPython instance (as opposed to embedded)
102
101
103 `IPython.embed()` puts a shell in a particular calling scope,
102 `IPython.embed()` puts a shell in a particular calling scope,
104 such as a function or method for debugging purposes,
103 such as a function or method for debugging purposes,
105 which is often not desirable.
104 which is often not desirable.
106
105
107 `start_ipython()` does full, regular IPython initialization,
106 `start_ipython()` does full, regular IPython initialization,
108 including loading startup files, configuration, etc.
107 including loading startup files, configuration, etc.
109 much of which is skipped by `embed()`.
108 much of which is skipped by `embed()`.
110
109
111 This is a public API method, and will survive implementation changes.
110 This is a public API method, and will survive implementation changes.
112
111
113 Parameters
112 Parameters
114 ----------
113 ----------
115
116 argv : list or None, optional
114 argv : list or None, optional
117 If unspecified or None, IPython will parse command-line options from sys.argv.
115 If unspecified or None, IPython will parse command-line options from sys.argv.
118 To prevent any command-line parsing, pass an empty list: `argv=[]`.
116 To prevent any command-line parsing, pass an empty list: `argv=[]`.
119 user_ns : dict, optional
117 user_ns : dict, optional
120 specify this dictionary to initialize the IPython user namespace with particular values.
118 specify this dictionary to initialize the IPython user namespace with particular values.
121 kwargs : various, optional
119 **kwargs : various, optional
122 Any other kwargs will be passed to the Application constructor,
120 Any other kwargs will be passed to the Application constructor,
123 such as `config`.
121 such as `config`.
124 """
122 """
@@ -127,24 +125,23 b' def start_ipython(argv=None, **kwargs):'
127
125
128 def start_kernel(argv=None, **kwargs):
126 def start_kernel(argv=None, **kwargs):
129 """Launch a normal IPython kernel instance (as opposed to embedded)
127 """Launch a normal IPython kernel instance (as opposed to embedded)
130
128
131 `IPython.embed_kernel()` puts a shell in a particular calling scope,
129 `IPython.embed_kernel()` puts a shell in a particular calling scope,
132 such as a function or method for debugging purposes,
130 such as a function or method for debugging purposes,
133 which is often not desirable.
131 which is often not desirable.
134
132
135 `start_kernel()` does full, regular IPython initialization,
133 `start_kernel()` does full, regular IPython initialization,
136 including loading startup files, configuration, etc.
134 including loading startup files, configuration, etc.
137 much of which is skipped by `embed()`.
135 much of which is skipped by `embed()`.
138
136
139 Parameters
137 Parameters
140 ----------
138 ----------
141
142 argv : list or None, optional
139 argv : list or None, optional
143 If unspecified or None, IPython will parse command-line options from sys.argv.
140 If unspecified or None, IPython will parse command-line options from sys.argv.
144 To prevent any command-line parsing, pass an empty list: `argv=[]`.
141 To prevent any command-line parsing, pass an empty list: `argv=[]`.
145 user_ns : dict, optional
142 user_ns : dict, optional
146 specify this dictionary to initialize the IPython user namespace with particular values.
143 specify this dictionary to initialize the IPython user namespace with particular values.
147 kwargs : various, optional
144 **kwargs : various, optional
148 Any other kwargs will be passed to the Application constructor,
145 Any other kwargs will be passed to the Application constructor,
149 such as `config`.
146 such as `config`.
150 """
147 """
@@ -254,7 +254,7 b' class BaseIPythonApplication(Application):'
254
254
255 def excepthook(self, etype, evalue, tb):
255 def excepthook(self, etype, evalue, tb):
256 """this is sys.excepthook after init_crashhandler
256 """this is sys.excepthook after init_crashhandler
257
257
258 set self.verbose_crash=True to use our full crashhandler, instead of
258 set self.verbose_crash=True to use our full crashhandler, instead of
259 a regular traceback with a short message (crash_handler_lite)
259 a regular traceback with a short message (crash_handler_lite)
260 """
260 """
@@ -41,9 +41,9 b' class IPyAutocall(object):'
41
41
42 def set_ip(self, ip):
42 def set_ip(self, ip):
43 """ Will be used to set _ip point to current ipython instance b/f call
43 """ Will be used to set _ip point to current ipython instance b/f call
44
44
45 Override this method if you don't want this to happen.
45 Override this method if you don't want this to happen.
46
46
47 """
47 """
48 self._ip = ip
48 self._ip = ip
49
49
@@ -118,12 +118,12 b' class CachingCompiler(codeop.Compile):'
118 Parameters
118 Parameters
119 ----------
119 ----------
120 raw_code : str
120 raw_code : str
121 The raw cell code.
121 The raw cell code.
122 transformed_code : str
122 transformed_code : str
123 The executable Python source code to cache and compile.
123 The executable Python source code to cache and compile.
124 number : int
124 number : int
125 A number which forms part of the code's name. Used for the execution
125 A number which forms part of the code's name. Used for the execution
126 counter.
126 counter.
127
127
128 Returns
128 Returns
129 -------
129 -------
@@ -137,12 +137,12 b' class CachingCompiler(codeop.Compile):'
137 Parameters
137 Parameters
138 ----------
138 ----------
139 transformed_code : str
139 transformed_code : str
140 The executable Python source code to cache and compile.
140 The executable Python source code to cache and compile.
141 number : int
141 number : int
142 A number which forms part of the code's name. Used for the execution
142 A number which forms part of the code's name. Used for the execution
143 counter.
143 counter.
144 raw_code : str
144 raw_code : str
145 The raw code before transformation, if None, set to `transformed_code`.
145 The raw code before transformation, if None, set to `transformed_code`.
146
146
147 Returns
147 Returns
148 -------
148 -------
@@ -431,9 +431,9 b' def _deduplicate_completions(text: str, completions: _IC)-> _IC:'
431
431
432 Parameters
432 Parameters
433 ----------
433 ----------
434 text: str
434 text : str
435 text that should be completed.
435 text that should be completed.
436 completions: Iterator[Completion]
436 completions : Iterator[Completion]
437 iterator over the completions to deduplicate
437 iterator over the completions to deduplicate
438
438
439 Yields
439 Yields
@@ -474,9 +474,9 b' def rectify_completions(text: str, completions: _IC, *, _debug=False)->_IC:'
474
474
475 Parameters
475 Parameters
476 ----------
476 ----------
477 text: str
477 text : str
478 text that should be completed.
478 text that should be completed.
479 completions: Iterator[Completion]
479 completions : Iterator[Completion]
480 iterator over the completions to rectify
480 iterator over the completions to rectify
481
481
482 Notes
482 Notes
@@ -763,13 +763,13 b' def match_dict_keys(keys: List[Union[str, bytes, Tuple[Union[str, bytes]]]], pre'
763
763
764 Parameters
764 Parameters
765 ----------
765 ----------
766 keys:
766 keys
767 list of keys in dictionary currently being completed.
767 list of keys in dictionary currently being completed.
768 prefix:
768 prefix
769 Part of the text already typed by the user. E.g. `mydict[b'fo`
769 Part of the text already typed by the user. E.g. `mydict[b'fo`
770 delims:
770 delims
771 String of delimiters to consider when finding the current key.
771 String of delimiters to consider when finding the current key.
772 extra_prefix: optional
772 extra_prefix : optional
773 Part of the text already typed in multi-key index cases. E.g. for
773 Part of the text already typed in multi-key index cases. E.g. for
774 `mydict['foo', "bar", 'b`, this would be `('foo', 'bar')`.
774 `mydict['foo', "bar", 'b`, this would be `('foo', 'bar')`.
775
775
@@ -993,7 +993,7 b' def _formatparamchildren(parameter) -> str:'
993
993
994 Parameters
994 Parameters
995 ----------
995 ----------
996 parameter:
996 parameter
997 Jedi's function `Param`
997 Jedi's function `Param`
998
998
999 Returns
999 Returns
@@ -1013,7 +1013,7 b' def _make_signature(completion)-> str:'
1013
1013
1014 Parameters
1014 Parameters
1015 ----------
1015 ----------
1016 completion: jedi.Completion
1016 completion : jedi.Completion
1017 object does not complete a function type
1017 object does not complete a function type
1018
1018
1019 Returns
1019 Returns
@@ -1854,9 +1854,9 b' class IPCompleter(Completer):'
1854
1854
1855 Parameters
1855 Parameters
1856 ----------
1856 ----------
1857 text:str
1857 text : str
1858 Full text of the current input, multi line string.
1858 Full text of the current input, multi line string.
1859 offset:int
1859 offset : int
1860 Integer representing the position of the cursor in ``text``. Offset
1860 Integer representing the position of the cursor in ``text``. Offset
1861 is 0-based indexed.
1861 is 0-based indexed.
1862
1862
@@ -101,25 +101,19 b' class CrashHandler(object):'
101
101
102 Parameters
102 Parameters
103 ----------
103 ----------
104 app : Application
104 app : Application
105 A running :class:`Application` instance, which will be queried at
105 A running :class:`Application` instance, which will be queried at
106 crash time for internal information.
106 crash time for internal information.
107
108 contact_name : str
107 contact_name : str
109 A string with the name of the person to contact.
108 A string with the name of the person to contact.
110
111 contact_email : str
109 contact_email : str
112 A string with the email address of the contact.
110 A string with the email address of the contact.
113
114 bug_tracker : str
111 bug_tracker : str
115 A string with the URL for your project's bug tracker.
112 A string with the URL for your project's bug tracker.
116
117 show_crash_traceback : bool
113 show_crash_traceback : bool
118 If false, don't print the crash traceback on stderr, only generate
114 If false, don't print the crash traceback on stderr, only generate
119 the on-disk report
115 the on-disk report
120
116 Non-argument instance attributes
121 Non-argument instance attributes:
122
123 These instances contain some non-argument attributes which allow for
117 These instances contain some non-argument attributes which allow for
124 further customization of the crash handler's behavior. Please see the
118 further customization of the crash handler's behavior. Please see the
125 source for further details.
119 source for further details.
@@ -109,7 +109,6 b' class Tracer(object):'
109
109
110 Parameters
110 Parameters
111 ----------
111 ----------
112
113 colors : str, optional
112 colors : str, optional
114 The name of the color scheme to use, it must be one of IPython's
113 The name of the color scheme to use, it must be one of IPython's
115 valid color schemes. If not given, the function will default to
114 valid color schemes. If not given, the function will default to
@@ -62,7 +62,7 b' def publish_display_data(data, metadata=None, source=None, *, transient=None, **'
62 Unused.
62 Unused.
63 transient : dict, keyword-only
63 transient : dict, keyword-only
64 A dictionary of transient data, such as display_id.
64 A dictionary of transient data, such as display_id.
65 """
65 """
66 from IPython.core.interactiveshell import InteractiveShell
66 from IPython.core.interactiveshell import InteractiveShell
67
67
68 display_pub = InteractiveShell.instance().display_pub
68 display_pub = InteractiveShell.instance().display_pub
@@ -133,12 +133,11 b' def display('
133 clear : bool, optional
133 clear : bool, optional
134 Should the output area be cleared before displaying anything? If True,
134 Should the output area be cleared before displaying anything? If True,
135 this will wait for additional output before clearing. [default: False]
135 this will wait for additional output before clearing. [default: False]
136 kwargs: additional keyword-args, optional
136 **kwargs : additional keyword-args, optional
137 Additional keyword-arguments are passed through to the display publisher.
137 Additional keyword-arguments are passed through to the display publisher.
138
138
139 Returns
139 Returns
140 -------
140 -------
141
142 handle: DisplayHandle
141 handle: DisplayHandle
143 Returns a handle on updatable displays for use with :func:`update_display`,
142 Returns a handle on updatable displays for use with :func:`update_display`,
144 if `display_id` is given. Returns :any:`None` if no `display_id` is given
143 if `display_id` is given. Returns :any:`None` if no `display_id` is given
@@ -146,7 +145,6 b' def display('
146
145
147 Examples
146 Examples
148 --------
147 --------
149
150 >>> class Json(object):
148 >>> class Json(object):
151 ... def __init__(self, json):
149 ... def __init__(self, json):
152 ... self.json = json
150 ... self.json = json
@@ -185,12 +183,10 b' def display('
185
183
186 See Also
184 See Also
187 --------
185 --------
188
189 :func:`update_display`
186 :func:`update_display`
190
187
191 Notes
188 Notes
192 -----
189 -----
193
194 In Python, objects can declare their textual representation using the
190 In Python, objects can declare their textual representation using the
195 `__repr__` method. IPython expands on this idea and allows objects to declare
191 `__repr__` method. IPython expands on this idea and allows objects to declare
196 other, rich representations including:
192 other, rich representations including:
@@ -300,15 +296,13 b' def update_display(obj, *, display_id, **kwargs):'
300
296
301 Parameters
297 Parameters
302 ----------
298 ----------
303
299 obj
304 obj:
305 The object with which to update the display
300 The object with which to update the display
306 display_id: keyword-only
301 display_id : keyword-only
307 The id of the display to update
302 The id of the display to update
308
303
309 See Also
304 See Also
310 --------
305 --------
311
312 :func:`display`
306 :func:`display`
313 """
307 """
314 kwargs['update'] = True
308 kwargs['update'] = True
@@ -343,10 +337,9 b' class DisplayHandle(object):'
343
337
344 Parameters
338 Parameters
345 ----------
339 ----------
346
340 obj
347 obj:
348 object to display
341 object to display
349 **kwargs:
342 **kwargs
350 additional keyword arguments passed to display
343 additional keyword arguments passed to display
351 """
344 """
352 display(obj, display_id=self.display_id, **kwargs)
345 display(obj, display_id=self.display_id, **kwargs)
@@ -356,10 +349,9 b' class DisplayHandle(object):'
356
349
357 Parameters
350 Parameters
358 ----------
351 ----------
359
352 obj
360 obj:
361 object to display
353 object to display
362 **kwargs:
354 **kwargs
363 additional keyword arguments passed to update_display
355 additional keyword arguments passed to update_display
364 """
356 """
365 update_display(obj, display_id=self.display_id, **kwargs)
357 update_display(obj, display_id=self.display_id, **kwargs)
General Comments 0
You need to be logged in to leave comments. Login now