Skip to content

Commit 69f4743

Browse files
authored
Merge pull request #260 from materialsproject/lobster_tidying
Tidy lobster workflow
2 parents 4668fc3 + bf5dbf1 commit 69f4743

File tree

23 files changed

+456
-561
lines changed

23 files changed

+456
-561
lines changed

src/atomate2/lobster/jobs.py

+13-17
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,29 @@
2525
class LobsterMaker(Maker):
2626
"""
2727
LOBSTER job maker.
28-
The maker copies the DFT output files
29-
necessary for the LOBSTER run.
30-
It will create all lobsterin files, run LOBSTER,
31-
zip the outputs and parse the LOBSTER outputs.
28+
29+
The maker copies DFT output files necessary for the LOBSTER run. It will create all
30+
lobsterin files, run LOBSTER, zip the outputs and parse the LOBSTER outputs.
3231
3332
Parameters
3433
----------
3534
name : str
3635
Name of jobs produced by this maker.
37-
resubmit : bool
38-
Maybe useful.
3936
task_document_kwargs : dict
4037
Keyword arguments passed to :obj:`.LobsterTaskDocument.from_directory`.
41-
user_lobsterin_settings: dict
38+
user_lobsterin_settings : dict
4239
Dict including additional information on the Lobster settings.
43-
additional_outputs: list[str]
44-
A list including additional output files.
45-
calculation_type: str
46-
Type of calculation for the Lobster run.
40+
run_lobster_kwargs : dict
41+
Keyword arguments that will get passed to :obj:`.run_lobster`.
42+
calculation_type : str
43+
Type of calculation for the Lobster run that will get passed to
44+
:obj:`.Lobsterin.standard_calculations_from_vasp_files`.
4745
"""
4846

4947
name: str = "lobster"
50-
resubmit: bool = False
5148
task_document_kwargs: dict = field(default_factory=dict)
5249
user_lobsterin_settings: dict | None = None
53-
additional_outputs: list | None = None
50+
run_lobster_kwargs: dict = field(default_factory=dict)
5451
calculation_type: str = "standard"
5552

5653
@job(output_schema=LobsterTaskDocument, data=[CompleteCohp, LobsterCompleteDos])
@@ -84,17 +81,16 @@ def make(
8481
lobsterin[key] = parameter
8582

8683
lobsterin.write_lobsterin("lobsterin")
84+
8785
# run lobster
8886
logger.info("Running LOBSTER")
89-
run_lobster()
87+
run_lobster(**self.run_lobster_kwargs)
9088

9189
# gzip folder
9290
gzip_dir(".")
9391

9492
# parse lobster outputs
95-
task_doc = LobsterTaskDocument.from_directory(
93+
return LobsterTaskDocument.from_directory(
9694
Path.cwd(),
9795
**self.task_document_kwargs,
98-
additional_fields=self.additional_outputs,
9996
)
100-
return task_doc

src/atomate2/lobster/run.py

+7-10
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919

2020
from atomate2 import SETTINGS
2121

22-
__all__ = [
23-
"JobType",
24-
"run_lobster",
25-
]
22+
__all__ = ["JobType", "run_lobster"]
2623

2724
_DEFAULT_VALIDATORS = (LobsterFilesValidator(), EnoughBandsValidator())
2825
_DEFAULT_HANDLERS = ()
@@ -57,17 +54,17 @@ def run_lobster(
5754
5855
Parameters
5956
----------
60-
job_type: str or .JobType
57+
job_type : str or .JobType
6158
The job type.
62-
lobster_cmd: str
59+
lobster_cmd : str
6360
Command to run lobster.
64-
max_errors:
61+
max_errors : int
6562
Maximum number of errors.
66-
scratch_dir: str or Path
63+
scratch_dir : str or Path
6764
Scratch directory.
68-
validators: list of .Validator
65+
validators : list of .Validator
6966
The validators handlers used by custodian.
70-
lobster_job_kwargs: dict
67+
lobster_job_kwargs : dict
7168
Keyword arguments that are passed to :obj:`.LosterJob`.
7269
custodian_kwargs : dict
7370
Keyword arguments that are passed to :obj:`.Custodian`.

0 commit comments

Comments
 (0)