Skip to content

Commit

Permalink
Merge branch 'devel' into isort
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
  • Loading branch information
njzjz authored Feb 6, 2023
2 parents fb24871 + 7a1ceb4 commit acf8c2a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 37 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,11 @@ repos:
hooks:
- id: isort
files: \.py$
# numpydoc
- repo: https://github.com/Carreau/velin
rev: 0.0.12
hooks:
- id: velin
args: ["--write"]
ci:
autoupdate_branch: devel
37 changes: 18 additions & 19 deletions dpgen/auto_test/Property.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def __init__(self, parameter):
Parameters
----------
parameters : dict
A dict that defines the property.
parameter : dict
A dict that defines the property.
"""
pass

Expand All @@ -31,17 +31,17 @@ def make_confs(self, path_to_work, path_to_equi, refine=False):
Parameters
----------
path_to_work : str
The path where the tasks for the property are located
The path where the tasks for the property are located
path_to_equi : str
-refine == False: The path to the directory that equilibrated the configuration.
-refine == True: The path to the directory that has property confs.
refine: str
To refine existing property confs or generate property confs from a equilibrated conf
-refine == False: The path to the directory that equilibrated the configuration.
-refine == True: The path to the directory that has property confs.
refine : str
To refine existing property confs or generate property confs from a equilibrated conf
Returns
-------
task_list: list of str
The list of task directories.
The list of task directories.
"""
pass

Expand Down Expand Up @@ -76,11 +76,11 @@ def compute(self, output_file, print_file, path_to_work):
Parameters
----------
output_file:
The file to output the property in json format
The file to output the property in json format
print_file:
The file to output the property in txt format
The file to output the property in txt format
path_to_work:
The working directory where the computational tasks locate.
The working directory where the computational tasks locate.
"""
path_to_work = os.path.abspath(path_to_work)
task_dirs = glob.glob(os.path.join(path_to_work, "task.[0-9]*[0-9]"))
Expand Down Expand Up @@ -113,17 +113,16 @@ def _compute_lower(self, output_file, all_tasks, all_res):
Parameters
----------
output_file:
The file to output the property
The file to output the property
all_tasks : list of str
The list of directories to the tasks
The list of directories to the tasks
all_res : list of str
The list of results
The list of results
Returns:
-------
res_data: dist
The dict storing the result of the property
ptr_data: str
The result printed in string format
res_data : dist
The dict storing the result of the property
ptr_data : str
The result printed in string format
"""
pass
40 changes: 22 additions & 18 deletions dpgen/auto_test/Task.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ def __init__(self, inter_parameter, path_to_poscar):
Parameters
----------
inter_parameter : dict
A dict that specifies the interaction.
A dict that specifies the interaction.
path_to_poscar : str
The path to POSCAR. Indicating in which system the task will be initialized.
The path to POSCAR. Indicating in which system the task will be initialized.
"""
pass

Expand All @@ -27,9 +27,12 @@ def make_potential_files(self, output_dir):
Parameters
----------
output_dir : str
The directory storing the potential files.
Outputs
-------
The directory storing the potential files.
Notes
-----
The following files are generated:
inter.json: output file
The task information is stored in `output_dir/inter.json`
"""
Expand All @@ -45,15 +48,15 @@ def make_input_file(self, output_dir, task_type, task_param):
Parameters
----------
output_dir : str
The directory storing the input files.
The directory storing the input files.
task_type : str
Can be
- "relaxation:": structure relaxation
- "static": static computation calculates the energy, force... of a strcture
task_parame: dict
The parameters of the task.
For example the VASP interaction can be provided with
{ "ediff": 1e-6, "ediffg": 1e-5 }
Can be
- "relaxation:": structure relaxation
- "static": static computation calculates the energy, force... of a strcture
task_param : dict
The parameters of the task.
For example the VASP interaction can be provided with
{ "ediff": 1e-6, "ediffg": 1e-5 }
"""
pass

Expand All @@ -66,16 +69,17 @@ def compute(self, output_dir):
Parameters
----------
output_dir : str
The directory storing the input and output files.
The directory storing the input and output files.
Returns
-------
result_dict: dict
A dict that storing the result. For example:
{ "energy": xxx, "force": [xxx] }
A dict that storing the result. For example:
{ "energy": xxx, "force": [xxx] }
Outputs
-------
Notes
-----
The following files are generated:
CONTCAR: output file
The output configuration is converted to CONTCAR and stored in the `output_dir`
"""
Expand Down

0 comments on commit acf8c2a

Please sign in to comment.