Skip to content

Commit cc6570b

Browse files
committed
remove few more os.path.join() noops
1 parent f1a01a3 commit cc6570b

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

atomate/common/firetasks/glue_tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def run_task(self, fw_spec):
231231
if self.get("relative_path", True):
232232
new_dir = os.path.join(os.getcwd(), self["folder_name"])
233233
else:
234-
new_dir = os.path.join(self["folder_name"])
234+
new_dir = self["folder_name"]
235235
if not os.path.exists(new_dir):
236236
os.makedirs(new_dir)
237237
if self.get("change_dir", False):

atomate/utils/tests/test_loaders.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
# TODO: @computron - move this test if you also move the loader code -computron
1010

11+
module_dir = os.path.dirname(os.path.abspath(__file__))
12+
1113

1214
class FuncTest(PymatgenTest):
1315
def setUp(self):
1416
self.structure = PymatgenTest.get_structure("Si")
1517

1618
def test_get_wf_from_spec_dict(self):
17-
d = loadfn(
18-
os.path.join(os.path.abspath(os.path.dirname(__file__)), "spec.yaml")
19-
)
19+
d = loadfn(os.path.join(module_dir, "spec.yaml"))
2020
wf = get_wf_from_spec_dict(self.structure, d)
2121
self.assertEqual(len(wf.fws), 4)
2222
for f in wf.fws:
@@ -25,16 +25,12 @@ def test_get_wf_from_spec_dict(self):
2525
self.assertEqual(sorted(len(v) for v in wf.links.values()), [0, 0, 1, 2])
2626

2727
self.assertEqual(wf.name, "Si:band structure")
28-
d = loadfn(
29-
os.path.join(os.path.abspath(os.path.dirname(__file__)), "badspec.yaml")
30-
)
28+
d = loadfn(os.path.join(module_dir, "badspec.yaml"))
3129

3230
self.assertRaises(ImportError, get_wf_from_spec_dict, self.structure, d)
3331

3432
def test_multi_parent(self):
35-
d = loadfn(
36-
os.path.join(os.path.abspath(os.path.dirname(__file__)), "spec_multi.yaml")
37-
)
33+
d = loadfn(os.path.join(module_dir, "spec_multi.yaml"))
3834
wf = get_wf_from_spec_dict(self.structure, d)
3935
self.assertEqual(len(wf.fws), 3)
4036
self.assertEqual(sorted(len(v) for v in wf.links.values()), [0, 1, 1])

scripts/atwf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ common_params:
3535
db_file: None
3636
"""
3737

38-
presets_dir = os.path.join(os.path.dirname(os.path.abspath(core.__file__)))
38+
presets_dir = os.path.dirname(os.path.abspath(core.__file__))
3939
lpad = LaunchPad.auto_load()
4040

4141

0 commit comments

Comments
 (0)