Skip to content

Commit

Permalink
Merge pull request #17 from benshi97/class_format
Browse files Browse the repository at this point in the history
Class_format
  • Loading branch information
benshi97 authored Jul 25, 2024
2 parents 7c92597 + 760b52c commit 5b16a89
Show file tree
Hide file tree
Showing 10 changed files with 2,313 additions and 2,613 deletions.
2,479 changes: 1,258 additions & 1,221 deletions src/quacc/atoms/skzcam.py

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/quacc/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ class MaxwellBoltzmanDistributionKwargs(TypedDict, total=False):

# ----------- Atoms handling type hints -----------


ElementStr = Literal[
"H",
"He",
Expand Down Expand Up @@ -248,6 +247,11 @@ class FindAdsSitesKwargs(TypedDict, total=False):

# ----------- Atoms (skzcam) handling type hints -----------

class SKZCAMOutput(TypedDict):
adsorbate_slab_embedded_cluster: Atoms
quantum_cluster_indices_set: list[list[int]]
ecp_region_indices_set: list[list[int]]

class ElementInfo(TypedDict):
core: int
basis: str
Expand Down
35 changes: 20 additions & 15 deletions tests/core/atoms/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,27 @@
FILE_DIR = Path(__file__).parent


def mock_generate_chemshell_cluster(
slab, slab_center_idx, atom_oxi_states, filepath, **kwargs
):
with (
gzip.open(
Path(FILE_DIR, "skzcam_files", "REF_ChemShell_cluster.xyz.gz"), "rb"
) as f_in,
Path(filepath, "ChemShell_cluster.xyz").open(mode="wb") as f_out,
):
shutil.copyfileobj(f_in, f_out)
def mock_run_chemshell(*args, filepath=".", write_xyz_file=False, **kwargs):
if write_xyz_file:
with (
gzip.open(
Path(FILE_DIR, "skzcam_files", "REF_ChemShell_Cluster.xyz.gz"), "rb"
) as f_in,
Path(filepath).with_suffix(".xyz").open(mode="wb") as f_out,
):
shutil.copyfileobj(f_in, f_out)
else:
with (
gzip.open(
Path(FILE_DIR, "skzcam_files", "ChemShell_Cluster.pun.gz"), "rb"
) as f_in,
Path(filepath).with_suffix(".pun").open(mode="wb") as f_out,
):
shutil.copyfileobj(f_in, f_out)


@pytest.fixture(autouse=True)
def patch_generate_chemshell_cluster(monkeypatch):
from quacc.atoms import skzcam
def patch_run_chemshell(monkeypatch):
from quacc.atoms.skzcam import CreateSKZCAMClusters

monkeypatch.setattr(
skzcam, "generate_chemshell_cluster", mock_generate_chemshell_cluster
)
monkeypatch.setattr(CreateSKZCAMClusters, "run_chemshell", mock_run_chemshell)
Binary file added tests/core/atoms/skzcam_files/CO_MgO.poscar.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 5b16a89

Please sign in to comment.