read_structure_using_ase#

casm.tools.shared.ase_utils.read_structure_using_ase(
path: Path,
format: str | None = None,
make_casm_structure_f: Callable[[Atoms], Structure] | None = None,
) Structure[source]#

Read a structure using ASE’s read function.

Attention

This method does not read magnetic moments.

Parameters:
  • path (Path) – The path to the structure file.

  • format (Optional[str]=None) – The format to use for reading the file. If None, ASE will try to infer the format from the file extension.

  • make_casm_structure_f (Callable[[Atoms], Structure]) – A function to convert an ASE Atoms object to a CASM structure. If None, the default function, make_casm_structure(), is used, which works for non-magnetic atomic structures.

Returns:

casm_structure – A CASM Structure read from the file.

Return type:

Structure