-
Notifications
You must be signed in to change notification settings - Fork 867
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add default species dir option for inputs Restore the use of an environment variable to set the aims species directory * Fix errors in parsers 1) Remove the filter for deciding if line is in a header or calc chunk Done since some lines appear in both 2) Remove stray call to an atoms object made from the atomate2 parsers Modify the AimsOutput test for Si to use phonon calc file and not a relaxation to check part 2 * Fix error to use f-strings had an fstring but did not specify it was * Add header information to all source files Add myself and @ansobolev as authors * Reduce test of default species dir No need to retest everything, just the one functionality
- Loading branch information
1 parent
605757f
commit 77a92bd
Showing
8 changed files
with
59 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
from __future__ import annotations | ||
|
||
import gzip | ||
import os | ||
import time | ||
from copy import deepcopy | ||
from dataclasses import dataclass, field | ||
|
@@ -20,6 +21,11 @@ | |
if TYPE_CHECKING: | ||
from collections.abc import Sequence | ||
|
||
__author__ = "Thomas A. R. Purcell" | ||
__version__ = "1.0" | ||
__email__ = "[email protected]" | ||
__date__ = "November 2023" | ||
|
||
|
||
@dataclass | ||
class AimsGeometryIn(MSONable): | ||
|
@@ -566,7 +572,8 @@ def write_file( | |
fd.write(cube.control_block) | ||
|
||
fd.write(lim + "\n\n") | ||
fd.write(self.get_species_block(structure, self._parameters["species_dir"])) | ||
species_dir = self._parameters.get("species_dir", os.environ.get("AIMS_SPECIES_DIR")) | ||
fd.write(self.get_species_block(structure, species_dir)) | ||
|
||
def get_species_block(self, structure: Structure | Molecule, species_dir: str | Path) -> str: | ||
"""Get the basis set information for a structure | ||
|
@@ -592,7 +599,7 @@ def get_species_block(self, structure: Structure | Molecule, species_dir: str | | |
with gzip.open(f"{filename}.gz", "rt") as sf: | ||
sb += "".join(sf.readlines()) | ||
else: | ||
raise ValueError("Species file for {sp.symbol} not found.") | ||
raise ValueError(f"Species file for {sp.symbol} not found.") | ||
|
||
return sb | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,11 @@ | |
|
||
from pymatgen.core import Molecule, Structure | ||
|
||
__author__ = "Andrey Sobolev and Thomas A. R. Purcell" | ||
__version__ = "1.0" | ||
__email__ = "[email protected] and [email protected]" | ||
__date__ = "November 2023" | ||
|
||
|
||
class AimsOutput(MSONable): | ||
"""The main output file for FHI-aims.""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,11 @@ | |
|
||
from emmet.core.math import Matrix3D, Vector3D | ||
|
||
__author__ = "Thomas A. R. Purcell and Andrey Sobolev" | ||
__version__ = "1.0" | ||
__email__ = "[email protected] and [email protected]" | ||
__date__ = "November 2023" | ||
|
||
# TARP: Originally an object, but type hinting needs this to be an int | ||
LINE_NOT_FOUND = -1000 | ||
EV_PER_A3_TO_KBAR = 1.60217653e-19 * 1e22 | ||
|
@@ -997,7 +1002,7 @@ def get_aims_out_chunks(content: str | TextIOWrapper, header_chunk: AimsOutHeade | |
Yields: | ||
The next AimsOutChunk | ||
""" | ||
lines = list(filter(lambda x: x not in header_chunk.lines, get_lines(content))) | ||
lines = get_lines(content)[len(header_chunk.lines) :] | ||
if len(lines) == 0: | ||
return | ||
|
||
|
@@ -1122,7 +1127,9 @@ def read_aims_output_from_content( | |
check_convergence(chunks, non_convergence_ok) | ||
# Relaxations have an additional footer chunk due to how it is split | ||
images = ( | ||
[chunk.structure for chunk in chunks[:-1]] if header_chunk.is_relaxation else [chunk.atoms for chunk in chunks] | ||
[chunk.structure for chunk in chunks[:-1]] | ||
if header_chunk.is_relaxation | ||
else [chunk.structure for chunk in chunks] | ||
) | ||
return images[index] | ||
|
||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters