Skip to content

Commit 7a1ceb4

Browse files
authored
fix numpydoc styles (#1134)
fix numpydoc styles
1 parent b5423bf commit 7a1ceb4

File tree

3 files changed

+46
-37
lines changed

3 files changed

+46
-37
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,11 @@ repos:
2323
rev: 22.12.0
2424
hooks:
2525
- id: black-jupyter
26+
# numpydoc
27+
- repo: https://github.com/Carreau/velin
28+
rev: 0.0.12
29+
hooks:
30+
- id: velin
31+
args: ["--write"]
2632
ci:
2733
autoupdate_branch: devel

dpgen/auto_test/Property.py

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def __init__(self, parameter):
1616
1717
Parameters
1818
----------
19-
parameters : dict
20-
A dict that defines the property.
19+
parameter : dict
20+
A dict that defines the property.
2121
"""
2222
pass
2323

@@ -31,17 +31,17 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
3131
Parameters
3232
----------
3333
path_to_work : str
34-
The path where the tasks for the property are located
34+
The path where the tasks for the property are located
3535
path_to_equi : str
36-
-refine == False: The path to the directory that equilibrated the configuration.
37-
-refine == True: The path to the directory that has property confs.
38-
refine: str
39-
To refine existing property confs or generate property confs from a equilibrated conf
36+
-refine == False: The path to the directory that equilibrated the configuration.
37+
-refine == True: The path to the directory that has property confs.
38+
refine : str
39+
To refine existing property confs or generate property confs from a equilibrated conf
4040
4141
Returns
4242
-------
4343
task_list: list of str
44-
The list of task directories.
44+
The list of task directories.
4545
"""
4646
pass
4747

@@ -76,11 +76,11 @@ def compute(self, output_file, print_file, path_to_work):
7676
Parameters
7777
----------
7878
output_file:
79-
The file to output the property in json format
79+
The file to output the property in json format
8080
print_file:
81-
The file to output the property in txt format
81+
The file to output the property in txt format
8282
path_to_work:
83-
The working directory where the computational tasks locate.
83+
The working directory where the computational tasks locate.
8484
"""
8585
path_to_work = os.path.abspath(path_to_work)
8686
task_dirs = glob.glob(os.path.join(path_to_work, "task.[0-9]*[0-9]"))
@@ -113,17 +113,16 @@ def _compute_lower(self, output_file, all_tasks, all_res):
113113
Parameters
114114
----------
115115
output_file:
116-
The file to output the property
116+
The file to output the property
117117
all_tasks : list of str
118-
The list of directories to the tasks
118+
The list of directories to the tasks
119119
all_res : list of str
120-
The list of results
121-
120+
The list of results
122121
Returns:
123122
-------
124-
res_data: dist
125-
The dict storing the result of the property
126-
ptr_data: str
127-
The result printed in string format
123+
res_data : dist
124+
The dict storing the result of the property
125+
ptr_data : str
126+
The result printed in string format
128127
"""
129128
pass

dpgen/auto_test/Task.py

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ def __init__(self, inter_parameter, path_to_poscar):
1010
Parameters
1111
----------
1212
inter_parameter : dict
13-
A dict that specifies the interaction.
13+
A dict that specifies the interaction.
1414
path_to_poscar : str
15-
The path to POSCAR. Indicating in which system the task will be initialized.
15+
The path to POSCAR. Indicating in which system the task will be initialized.
1616
"""
1717
pass
1818

@@ -27,9 +27,12 @@ def make_potential_files(self, output_dir):
2727
Parameters
2828
----------
2929
output_dir : str
30-
The directory storing the potential files.
31-
Outputs
32-
-------
30+
The directory storing the potential files.
31+
32+
Notes
33+
-----
34+
The following files are generated:
35+
3336
inter.json: output file
3437
The task information is stored in `output_dir/inter.json`
3538
"""
@@ -45,15 +48,15 @@ def make_input_file(self, output_dir, task_type, task_param):
4548
Parameters
4649
----------
4750
output_dir : str
48-
The directory storing the input files.
51+
The directory storing the input files.
4952
task_type : str
50-
Can be
51-
- "relaxation:": structure relaxation
52-
- "static": static computation calculates the energy, force... of a strcture
53-
task_parame: dict
54-
The parameters of the task.
55-
For example the VASP interaction can be provided with
56-
{ "ediff": 1e-6, "ediffg": 1e-5 }
53+
Can be
54+
- "relaxation:": structure relaxation
55+
- "static": static computation calculates the energy, force... of a strcture
56+
task_param : dict
57+
The parameters of the task.
58+
For example the VASP interaction can be provided with
59+
{ "ediff": 1e-6, "ediffg": 1e-5 }
5760
"""
5861
pass
5962

@@ -66,16 +69,17 @@ def compute(self, output_dir):
6669
Parameters
6770
----------
6871
output_dir : str
69-
The directory storing the input and output files.
72+
The directory storing the input and output files.
7073
7174
Returns
7275
-------
7376
result_dict: dict
74-
A dict that storing the result. For example:
75-
{ "energy": xxx, "force": [xxx] }
77+
A dict that storing the result. For example:
78+
{ "energy": xxx, "force": [xxx] }
7679
77-
Outputs
78-
-------
80+
Notes
81+
-----
82+
The following files are generated:
7983
CONTCAR: output file
8084
The output configuration is converted to CONTCAR and stored in the `output_dir`
8185
"""

0 commit comments

Comments
 (0)