Skip to content

Commit 8274855

Browse files
authored
Merge pull request #725 from janosh/namefile-add-fwid
add_namefile include firework ID in file name
2 parents 7432be3 + 56fd501 commit 8274855

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

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

0 commit comments

Comments
 (0)