Skip to content

Commit

Permalink
Add new files
Browse files Browse the repository at this point in the history
  • Loading branch information
AntObi committed Dec 18, 2024
1 parent 381f9e6 commit 4d6f8d3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

19 changes: 17 additions & 2 deletions smact/dopant_prediction/doper.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
data_directory,
"species_rep/skipspecies_20221028_319ion_dim200_cosine_similarity.json",
)
SPECIES_M3GNET_MP2023_EFORM_COSINE_PATH = os.path.join(
data_directory, "species_rep/ion_embedding_M3GNet-MP-2023.11.1-oxi-Eform_cosine_similarity.json"
)

SPECIES_M3GNET_MP2023_GAP_COSINE_PATH = os.path.join(
data_directory, "species_rep/ion_embedding_SpeciesM3GNet-MP-2023.11.1-oxi-band_gap_SCRATCH.json"
)


class Doper:
Expand Down Expand Up @@ -52,10 +59,18 @@ def __init__(
# check if both are provided
if filepath and embedding:
raise ValueError("Only one of filepath or embedding should be provided")
if embedding and embedding != "skipspecies":
if embedding and embedding not in [
"skipspecies",
"M3GNet-MP-2023.11.1-oxi-Eform",
"M3GNet-MP-2023.11.1-oxi-band_gap",
]:
raise ValueError(f"Embedding {embedding} is not supported")
if embedding:
if embedding == "skipspecies":
self.cation_mutator = mutation.CationMutator.from_json(SKIPSSPECIES_COSINE_SIM_PATH)
elif embedding == "M3GNet-MP-2023.11.1-oxi-Eform":
self.cation_mutator = mutation.CationMutator.from_json(SPECIES_M3GNET_MP2023_EFORM_COSINE_PATH)
elif embedding == "M3GNet-MP-2023.11.1-oxi-band_gap":
self.cation_mutator = mutation.CationMutator.from_json(SPECIES_M3GNET_MP2023_GAP_COSINE_PATH)
elif filepath:
self.cation_mutator = mutation.CationMutator.from_json(filepath)
else:
Expand Down

0 comments on commit 4d6f8d3

Please sign in to comment.