Skip to content

Commit

Permalink
Improve type annotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
shyuep committed Jun 12, 2024
1 parent e572d34 commit d79c9c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pymatgen/core/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
from pymatgen.util.typing import CompositionLike, MillerIndex, PathLike, PbcLike, SpeciesLike

FileFormats = Literal["cif", "poscar", "cssr", "json", "yaml", "yml", "xsf", "mcsqs", "res", "pwmat", ""]
StructureSources = Literal["Materials Project"]


class Neighbor(Site):
Expand Down Expand Up @@ -2938,7 +2939,7 @@ def to(self, filename: PathLike = "", fmt: FileFormats = "", **kwargs) -> str:
return str(writer)

@classmethod
def from_id(cls, id: str, source: str = "Materials Project", **kwargs):
def from_id(cls, id: str, source: StructureSources = "Materials Project", **kwargs) -> Structure:
"""
Load a structure file based on an id, usually from an online source.
Expand Down

0 comments on commit d79c9c3

Please sign in to comment.