Skip to content

Commit

Permalink
Electronic (#2)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
tboland1 authored Apr 13, 2022
1 parent 10de4e2 commit 467e6af
Show file tree
Hide file tree
Showing 12 changed files with 1,758 additions and 756 deletions.
56 changes: 9 additions & 47 deletions hetero2d/firetasks/heteroiface_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@

from __future__ import division, print_function, unicode_literals, absolute_import

import fnmatch, glob, gzip, json, os, re

import glob, os, re
from six.moves import range
from copy import deepcopy
from importlib import import_module

from monty.json import jsanitize
from monty.serialization import dumpfn

from atomate.utils.utils import get_logger, env_chk
from pymatgen import Structure

from fireworks.core.firework import FiretaskBase, FWAction
from fireworks.utilities.fw_utilities import explicit_serialize
from pymatgen import Structure

from hetero2d.manipulate.utils import get_mongo_client
from atomate.utils.utils import get_logger, env_chk

from hetero2d.manipulate.utils import get_mongo_client


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

logger = get_logger(__name__)


def find(pattern, path):
"""
Finds a file on a given search path that matches the
pattern.
Args:
pattern (str): String to match on.
path (str): File path to search over.
Returns:
a list of files matching the criteria
"""
result = []
for root, dirs, files in os.walk(path):
for name in files:
if fnmatch.fnmatch(name, pattern):
result.append(name)
return result


def get_FWjson():
"""
Helper function which reads the FW.json file in the
local directory and returns the FW.json file.
"""
fw_file = find('FW.json*', '.')[0]

if fw_file == 'FW.json.gz':
with gzip.GzipFile('FW.json.gz', 'r') as p:
fw_json_file = json.loads(p.read().decode('utf-8'))
elif fw_file == 'FW.json':
with open('FW.json', 'rb') as p:
fw_json_file = json.load(p)

return fw_json_file


# Helper Functions
def _update_spec(additional_spec):
"""
Expand Down Expand Up @@ -174,7 +138,6 @@ def _update_spec(additional_spec):
"_dupefinder": {"_fw_name": "DupeFinderExact"}})
return default_spec


@explicit_serialize
class TransferSlabTask(FiretaskBase):
"""
Expand All @@ -184,8 +147,8 @@ class TransferSlabTask(FiretaskBase):
Args:
label (str): The name of the structure in the
additional_spec dict - struct_sub.
Returns:
Returns:
FWAction updating the spec
"""
required_params = ['label']
Expand All @@ -202,7 +165,6 @@ def run_task(self, fw_spec):

return FWAction(update_spec=update_spec)


@explicit_serialize
class CreateHeterostructureTask(FiretaskBase):
"""
Expand Down
Loading

0 comments on commit 467e6af

Please sign in to comment.