Skip to content

Commit b0ecd5c

Browse files
authored
format numpydoc (#306)
- add hook - format numpydoc
1 parent e955685 commit b0ecd5c

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ repos:
2020
rev: 22.12.0
2121
hooks:
2222
- id: black-jupyter
23+
# numpydoc
24+
- repo: https://github.com/Carreau/velin
25+
rev: 0.0.12
26+
hooks:
27+
- id: velin
28+
args: ["--write"]
2329
# Python inside docs
2430
- repo: https://github.com/asottile/blacken-docs
2531
rev: 1.13.0

dpdispatcher/ssh_context.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -673,9 +673,9 @@ def block_checkcall(self, cmd, asynchronously=False, stderr_whitelist=None):
673673
674674
Parameters
675675
----------
676-
cmd: str
676+
cmd : str
677677
The command to run.
678-
asynchronously: bool, optional, default=False
678+
asynchronously : bool, optional, default=False
679679
Run command asynchronously. If True, `nohup` will be used to run the command.
680680
"""
681681
assert self.remote_root is not None
@@ -795,16 +795,16 @@ def _put_files(
795795
796796
Parameters
797797
----------
798-
files: list
798+
files : list
799799
uploaded files
800-
dereference: bool, default: True
800+
dereference : bool, default: True
801801
If dereference is False, add symbolic and hard links to the archive.
802802
If it is True, add the content of the target files to the archive.
803803
This has no effect on systems that do not support symbolic links.
804-
directories: list, default: None
804+
directories : list, default: None
805805
uploaded directories non-recursively. Use `files` for uploading
806806
recursively
807-
tar_compress: bool, default: True
807+
tar_compress : bool, default: True
808808
If tar_compress is True, compress the archive using gzip
809809
It it is False, then it is uncompressed
810810
"""

dpdispatcher/utils.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def get_sha256(filename):
1414
1515
Parameters
1616
----------
17-
filename: str
17+
filename : str
1818
The filename.
1919
2020
Returns
@@ -49,12 +49,12 @@ def generate_totp(secret: str, period: int = 30, token_length: int = 6) -> str:
4949
5050
Parameters
5151
----------
52-
secret: str
52+
secret : str
5353
The encoded secret provided by the HPC. It's usually extracted
5454
from a 2D code and base32 encoded.
55-
period: int, default=30
55+
period : int, default=30
5656
Time period where the code is valid in seconds.
57-
token_length: int, default=6
57+
token_length : int, default=6
5858
The token length.
5959
6060
Returns
@@ -90,9 +90,9 @@ def rsync(
9090
9191
Parameters
9292
----------
93-
from_file: str
93+
from_file : str
9494
SRC
95-
to_file: str
95+
to_file : str
9696
DEST
9797
port : int, default=22
9898
port for ssh
@@ -149,11 +149,11 @@ def retry(
149149
150150
Parameters
151151
----------
152-
max_retry: int, default=3
152+
max_retry : int, default=3
153153
The maximum retry times. If None, it will retry forever.
154-
sleep: int or float, default=60
154+
sleep : int or float, default=60
155155
The sleep time in seconds.
156-
catch_exception: Exception, default=Exception
156+
catch_exception : Exception, default=Exception
157157
The exception to catch.
158158
159159
Returns

0 commit comments

Comments
 (0)