Skip to content

Commit 7bb1dad

Browse files
committed
Merge branch 'main' of github.com:hackingmaterials/atomate
2 parents cb634fd + 8b599b2 commit 7bb1dad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2069
-363
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@ repos:
44
hooks:
55
- id: autoflake
66
args: [--in-place, --remove-all-unused-imports, --remove-unused-variable, --ignore-init-module-imports]
7+
78
- repo: https://github.com/psf/black
8-
rev: 21.4b2
9+
rev: 21.11b1
910
hooks:
1011
- id: black
11-
- repo: https://gitlab.com/pycqa/flake8
12-
rev: 3.8.4
12+
13+
- repo: https://github.com/pycqa/flake8
14+
rev: 4.0.1
1315
hooks:
1416
- id: flake8
1517
args: [--max-line-length=125]
18+
1619
- repo: https://github.com/pre-commit/pre-commit-hooks
17-
rev: v3.4.0
20+
rev: v4.0.1
1821
hooks:
1922
- id: check-yaml
2023
- id: end-of-file-fixer

atomate/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.0.1"
1+
__version__ = "1.0.1"

atomate/common/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__author__ = 'Anubhav Jain <[email protected]>'
1+
__author__ = "Anubhav Jain <[email protected]>"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__author__ = 'Anubhav Jain <[email protected]>'
1+
__author__ = "Anubhav Jain <[email protected]>"

atomate/common/firetasks/parse_outputs.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import json
22
import os
33

4-
from fireworks import explicit_serialize, FiretaskBase, FWAction
5-
from fireworks.utilities.fw_serializers import DATETIME_HANDLER
6-
7-
from atomate.utils.utils import env_chk, get_logger, load_class
84
from atomate.common.firetasks.glue_tasks import get_calc_loc
5+
from atomate.utils.utils import env_chk, get_logger, load_class
6+
from fireworks import FiretaskBase, FWAction, explicit_serialize
7+
from fireworks.utilities.fw_serializers import DATETIME_HANDLER
98

109
__author__ = "Shyam Dwaraknath <[email protected]>, Anubhav Jain <[email protected]>"
1110

@@ -53,9 +52,7 @@ def run_task(self, fw_spec):
5352

5453
# parse the calc directory
5554
logger.info(
56-
"PARSING DIRECTORY: {} USING DRONE: {}".format(
57-
calc_dir, self["drone"].__class__.__name__
58-
)
55+
f"PARSING DIRECTORY: {calc_dir} USING DRONE: {self['drone'].__class__.__name__}"
5956
)
6057
# get the database connection
6158
db_file = env_chk(self.get("db_file"), fw_spec)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__author__ = 'Anubhav Jain <[email protected]>'
1+
__author__ = "Anubhav Jain <[email protected]>"

atomate/common/powerups.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import List
66

77
from atomate.utils.utils import get_fws_and_tasks
8-
from fireworks import Workflow, FileWriteTask
8+
from fireworks import FileWriteTask, Workflow
99
from fireworks.utilities.fw_utilities import get_slug
1010

1111
__author__ = "Janine George, Guido Petretto, Ryan Kingsbury"
@@ -86,21 +86,23 @@ def add_tags(original_wf, tags_list):
8686
return original_wf
8787

8888

89-
def add_namefile(original_wf, use_slug=True):
89+
def add_namefile(original_wf: Workflow, use_slug: bool = True) -> Workflow:
9090
"""
9191
Every FireWork begins by writing an empty file with the name
92-
"FW--<fw.name>". This makes it easy to figure out what jobs are in what
93-
launcher directories, e.g. "ls -l launch*/FW--*" from within a "block" dir.
92+
"FW--<fw.name>-<fw.fw_id>". This makes it easy to figure out what jobs are
93+
in what launcher directories, e.g. "ls -l launch*/FW--*" from within a
94+
"block" dir.
9495
9596
Args:
9697
original_wf (Workflow)
97-
use_slug (bool): whether to replace whitespace-type chars with a slug
98+
use_slug (bool): whether to replace whitespace-type chars with a slug.
99+
Defaults to True.
98100
99101
Returns:
100102
Workflow
101103
"""
102104
for idx, fw in enumerate(original_wf.fws):
103-
fname = f"FW--{fw.name}"
105+
fname = f"FW--{fw.name}-{fw.fw_id}"
104106
if use_slug:
105107
fname = get_slug(fname)
106108

atomate/feff/firetasks/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
from .glue_tasks import *
32
from .parse_outputs import *
43
from .run_calc import *

atomate/feff/fireworks/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
21
from .core import *

atomate/feff/fireworks/core.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(
3333
db_file=None,
3434
parents=None,
3535
metadata=None,
36-
**kwargs
36+
**kwargs,
3737
):
3838
"""
3939
Write the input set for FEFF-XAS spectroscopy, run FEFF and insert the absorption
@@ -63,7 +63,7 @@ def __init__(
6363
structure,
6464
edge=edge,
6565
radius=radius,
66-
**override_default_feff_params
66+
**override_default_feff_params,
6767
)
6868
spectrum_type = feff_input_set.__class__.__name__[2:-3]
6969

@@ -90,8 +90,8 @@ def __init__(
9090
super().__init__(
9191
t,
9292
parents=parents,
93-
name="{}-{}".format(structure.composition.reduced_formula, name),
94-
**kwargs
93+
name=f"{structure.composition.reduced_formula}-{name}",
94+
**kwargs,
9595
)
9696

9797

@@ -114,7 +114,7 @@ def __init__(
114114
db_file=None,
115115
parents=None,
116116
metadata=None,
117-
**kwargs
117+
**kwargs,
118118
):
119119
"""
120120
Write the input set for FEFF-EELSS spectroscopy, run feff and insert the core-loss spectrum
@@ -154,7 +154,7 @@ def __init__(
154154
collection_angle,
155155
convergence_angle,
156156
user_eels_settings=user_eels_settings,
157-
**override_default_feff_params
157+
**override_default_feff_params,
158158
)
159159
spectrum_type = feff_input_set.__class__.__name__[2:-3]
160160

@@ -181,8 +181,8 @@ def __init__(
181181
super().__init__(
182182
t,
183183
parents=parents,
184-
name="{}-{}".format(structure.composition.reduced_formula, name),
185-
**kwargs
184+
name=f"{structure.composition.reduced_formula}-{name}",
185+
**kwargs,
186186
)
187187

188188

@@ -203,7 +203,7 @@ def __init__(
203203
filepad_file=None,
204204
labels=None,
205205
metadata=None,
206-
**kwargs
206+
**kwargs,
207207
):
208208
"""
209209
Write the input set for FEFF-EXAFS spectroscopy with customized scattering paths, run feff,
@@ -237,7 +237,7 @@ def __init__(
237237
structure,
238238
edge=edge,
239239
radius=radius,
240-
**override_default_feff_params
240+
**override_default_feff_params,
241241
)
242242

243243
t = [
@@ -260,6 +260,6 @@ def __init__(
260260
super().__init__(
261261
t,
262262
parents=parents,
263-
name="{}-{}".format(structure.composition.reduced_formula, name),
264-
**kwargs
263+
name=f"{structure.composition.reduced_formula}-{name}",
264+
**kwargs,
265265
)

0 commit comments

Comments
 (0)