Skip to content

Commit 467e6af

Browse files
authoredApr 13, 2022
Electronic (#2)
* adding electronic properites workflow * first commit of new workflow * introduce new code: automate routine for computing electronic and bader * update vasp from prev for dos and bader * update workflow package imports, add new electronic workflow, move functions to logical modules * create parsers, now in workflow testing phase * fix workflow run bugs * update icharg value * modify run_calc file and workflow to do a double kpoint run for chgcar * update gridfs for dos * update parser output * update electronic workflow * fix bug in average_z_sep * fix bug in average_z_sep * add correct name to 2d-substrate heterostructs based on stacked wyckoff sites * fix bugs * update parse output * update run calc and core to use custom custodian handler * debugging run_calc and appending cdd analysis to same db entry as dos,bader run * modify run_calc to set npar. custodian currently does not search for the correct slurm variable to set npar. so i fixed it * updated ToDb: dos->element projected with 0.05 eV res and default [4,6] eV window around efermi. add user option for window * update obj_id variable pass * fix auto_npar * push obj_id to cdd calculation spec * add flags to depends to trigger slurm_npar * remove parent cdd_combined from iso NSCF, clarify error message in workflow, add task_label to additional_fields not tags * update cdd error message * fix bug in vasp interface set * fix logic error for vis_static; structure now updates to the isolated structures * add logger to CDD parser * delete random } * clean up unneeded comments * include amin. add option to include dipole correction in nscf calculation. fix cmdlrelaxset's ediff value. reformat name for electronicFW if not cdd. * change out final structure from previous run is obtained. * remove amin * fix pushing obj_id for combined system so the cdd analysis can be pushed to that obj_id * remove conflicting isym tag * clean up formatting of documents * change task_name to task_label * update parser * fix parse output * fix parse output * fix parse output * fix entry of dos into grid fs * don't push None to fw spec * fix brackets for database pushing * cleaning up store_data for cdd update * add logger info to processing document clean up debug code, add exception errors * fix logic error in slurm_npar * update docs, add get_dos utility, update parser to put completedos into database. machine learning needs that object * fix Electronic to DB parser. add z proj chg for NSCF structures * update decompress to describe behaviour of function * fix stupid error * add complete dos to import for utils * add todo
1 parent 10de4e2 commit 467e6af

12 files changed

+1758
-756
lines changed
 

‎hetero2d/firetasks/heteroiface_tasks.py

+9-47
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,23 @@
1010

1111
from __future__ import division, print_function, unicode_literals, absolute_import
1212

13-
import fnmatch, glob, gzip, json, os, re
14-
13+
import glob, os, re
1514
from six.moves import range
1615
from copy import deepcopy
1716
from importlib import import_module
1817

1918
from monty.json import jsanitize
2019
from monty.serialization import dumpfn
2120

22-
from atomate.utils.utils import get_logger, env_chk
21+
from pymatgen import Structure
22+
2323
from fireworks.core.firework import FiretaskBase, FWAction
2424
from fireworks.utilities.fw_utilities import explicit_serialize
25-
from pymatgen import Structure
2625

27-
from hetero2d.manipulate.utils import get_mongo_client
26+
from atomate.utils.utils import get_logger, env_chk
27+
28+
from hetero2d.manipulate.utils import get_mongo_client
29+
2830

2931
__author__ = 'Tara M. Boland'
3032
__copyright__ = "Copyright 2020, CMD Lab"
@@ -33,44 +35,6 @@
3335

3436
logger = get_logger(__name__)
3537

36-
37-
def find(pattern, path):
38-
"""
39-
Finds a file on a given search path that matches the
40-
pattern.
41-
42-
Args:
43-
pattern (str): String to match on.
44-
path (str): File path to search over.
45-
46-
Returns:
47-
a list of files matching the criteria
48-
"""
49-
result = []
50-
for root, dirs, files in os.walk(path):
51-
for name in files:
52-
if fnmatch.fnmatch(name, pattern):
53-
result.append(name)
54-
return result
55-
56-
57-
def get_FWjson():
58-
"""
59-
Helper function which reads the FW.json file in the
60-
local directory and returns the FW.json file.
61-
"""
62-
fw_file = find('FW.json*', '.')[0]
63-
64-
if fw_file == 'FW.json.gz':
65-
with gzip.GzipFile('FW.json.gz', 'r') as p:
66-
fw_json_file = json.loads(p.read().decode('utf-8'))
67-
elif fw_file == 'FW.json':
68-
with open('FW.json', 'rb') as p:
69-
fw_json_file = json.load(p)
70-
71-
return fw_json_file
72-
73-
7438
# Helper Functions
7539
def _update_spec(additional_spec):
7640
"""
@@ -174,7 +138,6 @@ def _update_spec(additional_spec):
174138
"_dupefinder": {"_fw_name": "DupeFinderExact"}})
175139
return default_spec
176140

177-
178141
@explicit_serialize
179142
class TransferSlabTask(FiretaskBase):
180143
"""
@@ -184,8 +147,8 @@ class TransferSlabTask(FiretaskBase):
184147
Args:
185148
label (str): The name of the structure in the
186149
additional_spec dict - struct_sub.
187-
188-
Returns:
150+
151+
Returns:
189152
FWAction updating the spec
190153
"""
191154
required_params = ['label']
@@ -202,7 +165,6 @@ def run_task(self, fw_spec):
202165

203166
return FWAction(update_spec=update_spec)
204167

205-
206168
@explicit_serialize
207169
class CreateHeterostructureTask(FiretaskBase):
208170
"""

0 commit comments

Comments
 (0)
Please sign in to comment.