Skip to content

Commit

Permalink
Improved get_mainfile_keys
Browse files Browse the repository at this point in the history
Defined DMFTMethod in DMFT workflow
  • Loading branch information
JosePizarro3 committed Jul 14, 2023
1 parent 9ff527f commit 3a7d87c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion electronicparsers/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def extract_section(source: EntryArchive, path: str):
def get_files(pattern: str, filepath: str, stripname: str = '', deep: bool = True):
"""Get files following the `pattern` with respect to the file `stripname` (usually this
being the mainfile of the given parser) up to / down from the `filepath` (`deep=True` going
up, `deep=False` down)
down, `deep=False` up)
Args:
pattern (str): targeted pattern to be found
Expand Down Expand Up @@ -301,6 +301,12 @@ def parse_dmft_workflow(self, wannier_archive: EntryArchive, dmft_workflow_archi
workflow = DMFT(method=DMFTMethod())
workflow.name = 'DMFT'

# Method
method_proj = extract_section(wannier_archive, 'run/method/projection')
method_dmft = extract_section(self.archive, 'run/method/dmft')
workflow.method.projection_method_ref = method_proj
workflow.method.dmft_method_ref = method_dmft

# Inputs and Outputs
input_structure = extract_section(wannier_archive, 'run/system')
wannier_calculation = extract_section(wannier_archive, 'run/calculation')
Expand Down
3 changes: 2 additions & 1 deletion electronicparsers/w2dynamics/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,8 @@ def parse_scc(self):
def init_parser(self):
self.data = None

def get_mainfile_keys(self, filepath):
def get_mainfile_keys(self, **kwargs):
filepath = kwargs.get('filename')
mainfile = os.path.basename(filepath)
wannier90_files = get_files('*.wout', filepath, mainfile, deep=False)
if len(wannier90_files) == 1:
Expand Down

0 comments on commit 3a7d87c

Please sign in to comment.