Skip to content

Commit 4f4eab2

Browse files
Carreaumwakaba2
authored andcommitted
DOC: Autoreformat docstrings.
This uses an autoreformatter to reformat and fix some of the common mistakes in numpydoc. Some of this is purely visual, but other like space before colon in parameters actually have semantic values. In the case of space before colon this is to make sure that nupmydoc properly distinguish the parameter name from its type.
1 parent d040e51 commit 4f4eab2

File tree

13 files changed

+52
-64
lines changed

13 files changed

+52
-64
lines changed

jupyter_server/_sysinfo.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ def pkg_commit_hash(pkg_path):
2626
Parameters
2727
----------
2828
pkg_path : str
29-
directory containing package
30-
only used for getting commit from active repo
29+
directory containing package
30+
only used for getting commit from active repo
3131
3232
Returns
3333
-------
3434
hash_from : str
35-
Where we got the hash from - description
35+
Where we got the hash from - description
3636
hash_str : str
37-
short form of hash
37+
short form of hash
3838
"""
3939

4040
# maybe we are in a repository, check for a .git folder
@@ -68,12 +68,12 @@ def pkg_info(pkg_path):
6868
Parameters
6969
----------
7070
pkg_path : str
71-
path containing __init__.py for package
71+
path containing __init__.py for package
7272
7373
Returns
7474
-------
7575
context : dict
76-
with named parameters of interest
76+
with named parameters of interest
7777
"""
7878
src, hsh = pkg_commit_hash(pkg_path)
7979
return dict(

jupyter_server/_tz.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def utc_method(*args, **kwargs):
3636

3737
def isoformat(dt):
3838
"""Return iso-formatted timestamp
39-
39+
4040
Like .isoformat(), but uses Z for UTC instead of +00:00
4141
"""
4242
return dt.isoformat().replace('+00:00', 'Z')

jupyter_server/auth/login.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def get_user(cls, handler):
196196
@classmethod
197197
def get_user_token(cls, handler):
198198
"""Identify the user based on a token in the URL or Authorization header
199-
199+
200200
Returns:
201201
- uuid if authenticated
202202
- None if not

jupyter_server/base/zmqhandlers.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def serialize_binary_message(msg):
3232
3333
Returns
3434
-------
35-
3635
The message serialized to bytes.
3736
3837
"""
@@ -64,7 +63,6 @@ def deserialize_binary_message(bmsg):
6463
6564
Returns
6665
-------
67-
6866
message dictionary
6967
"""
7068
nbufs = struct.unpack('!i', bmsg[:4])[0]

jupyter_server/extension/serverextension.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def _get_config_dir(user=False, sys_prefix=False):
2727
2828
Parameters
2929
----------
30-
3130
user : bool [default: False]
3231
Get the user's .jupyter config directory
3332
sys_prefix : bool [default: False]

jupyter_server/gateway/managers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def init_static_args(self):
293293

294294
def load_connection_args(self, **kwargs):
295295
"""Merges the static args relative to the connection, with the given keyword arguments. If statics
296-
have yet to be initialized, we'll do that here.
296+
have yet to be initialized, we'll do that here.
297297
298298
"""
299299
if len(self._static_args) == 0:
@@ -360,7 +360,7 @@ def _get_kernel_endpoint_url(self, kernel_id=None):
360360
361361
Parameters
362362
----------
363-
kernel_id: kernel UUID (optional)
363+
kernel_id : kernel UUID (optional)
364364
"""
365365
if kernel_id:
366366
return url_path_join(self.base_endpoint, url_escape(str(kernel_id)))
@@ -562,7 +562,7 @@ def _get_kernelspecs_endpoint_url(self, kernel_name=None):
562562
563563
Parameters
564564
----------
565-
kernel_name: kernel name (optional)
565+
kernel_name : kernel name (optional)
566566
"""
567567
if kernel_name:
568568
return url_path_join(self.base_endpoint, url_escape(kernel_name))

jupyter_server/serverapp.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,19 +1823,16 @@ def initialize(self, argv=None, find_extensions=True, new_httpserver=True, start
18231823
18241824
Parameters
18251825
----------
1826-
argv: list or None
1826+
argv : list or None
18271827
CLI arguments to parse.
1828-
1829-
find_extensions: bool
1828+
find_extensions : bool
18301829
If True, find and load extensions listed in Jupyter config paths. If False,
18311830
only load extensions that are passed to ServerApp directy through
18321831
the `argv`, `config`, or `jpserver_extensions` arguments.
1833-
1834-
new_httpserver: bool
1832+
new_httpserver : bool
18351833
If True, a tornado HTTPServer instance will be created and configured for the Server Web
18361834
Application. This will set the http_server attribute of this class.
1837-
1838-
starter_extension: str
1835+
starter_extension : str
18391836
If given, it references the name of an extension point that started the Server.
18401837
We will try to load configuration from extension point
18411838
"""

jupyter_server/services/contents/checkpoints.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,12 @@ def create_notebook_checkpoint(self, nb, path):
121121
def get_file_checkpoint(self, checkpoint_id, path):
122122
"""Get the content of a checkpoint for a non-notebook file.
123123
124-
Returns a dict of the form:
125-
{
126-
'type': 'file',
127-
'content': <str>,
128-
'format': {'text','base64'},
129-
}
124+
Returns a dict of the form:
125+
{
126+
'type': 'file',
127+
'content': <str>,
128+
'format': {'text','base64'},
129+
}
130130
"""
131131
raise NotImplementedError("must be implemented in a subclass")
132132

@@ -229,12 +229,12 @@ async def create_notebook_checkpoint(self, nb, path):
229229
async def get_file_checkpoint(self, checkpoint_id, path):
230230
"""Get the content of a checkpoint for a non-notebook file.
231231
232-
Returns a dict of the form:
233-
{
234-
'type': 'file',
235-
'content': <str>,
236-
'format': {'text','base64'},
237-
}
232+
Returns a dict of the form:
233+
{
234+
'type': 'file',
235+
'content': <str>,
236+
'format': {'text','base64'},
237+
}
238238
"""
239239
raise NotImplementedError("must be implemented in a subclass")
240240

jupyter_server/services/contents/fileio.py

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,14 @@ def atomic_writing(path, text=True, encoding='utf-8', log=None, **kwargs):
8686
Parameters
8787
----------
8888
path : str
89-
The target file to write to.
90-
89+
The target file to write to.
9190
text : bool, optional
92-
Whether to open the file in text mode (i.e. to write unicode). Default is
93-
True.
94-
91+
Whether to open the file in text mode (i.e. to write unicode). Default is
92+
True.
9593
encoding : str, optional
96-
The encoding to use for files opened in text mode. Default is UTF-8.
97-
94+
The encoding to use for files opened in text mode. Default is UTF-8.
9895
**kwargs
99-
Passed to :func:`io.open`.
96+
Passed to :func:`io.open`.
10097
"""
10198
# realpath doesn't work on Windows: https://bugs.python.org/issue9949
10299
# Luckily, we only need to resolve the file itself being a symlink, not
@@ -142,17 +139,14 @@ def _simple_writing(path, text=True, encoding='utf-8', log=None, **kwargs):
142139
Parameters
143140
----------
144141
path : str
145-
The target file to write to.
146-
142+
The target file to write to.
147143
text : bool, optional
148-
Whether to open the file in text mode (i.e. to write unicode). Default is
149-
True.
150-
144+
Whether to open the file in text mode (i.e. to write unicode). Default is
145+
True.
151146
encoding : str, optional
152-
The encoding to use for files opened in text mode. Default is UTF-8.
153-
147+
The encoding to use for files opened in text mode. Default is UTF-8.
154148
**kwargs
155-
Passed to :func:`io.open`.
149+
Passed to :func:`io.open`.
156150
"""
157151
# realpath doesn't work on Windows: https://bugs.python.org/issue9949
158152
# Luckily, we only need to resolve the file itself being a symlink, not

jupyter_server/services/contents/manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def increment_filename(self, filename, path='', insert=''):
326326
The name of a file, including extension
327327
path : unicode
328328
The API path of the target's directory
329-
insert: unicode
329+
insert : unicode
330330
The characters to insert after the base filename
331331
332332
Returns
@@ -691,7 +691,7 @@ async def increment_filename(self, filename, path='', insert=''):
691691
The name of a file, including extension
692692
path : unicode
693693
The API path of the target's directory
694-
insert: unicode
694+
insert : unicode
695695
The characters to insert after the base filename
696696
697697
Returns

0 commit comments

Comments
 (0)