Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ stk.plot3d(structure)
* `stk.build.high_index_surface()`
* `stk.build.get_high_index_surface_info()`
* `stk.build.sqs_structures()`
* `stk.build.pyxtal()`
* `stk.build.B2()`
* `stk.build.C14()`
* `stk.build.C15()`
Expand All @@ -60,4 +61,11 @@ stk.plot3d(structure)
### Common
* `stk.common.ase_to_pymatgen()`
* `stk.common.pymatgen_to_ase()`
* `stk.common.pymatgen_read_from_file()`
* `stk.common.ase_to_pyscal()`
* `stk.common.apply_strain()`
* `stk.common.center_coordinates_in_unit_cell()`
* `stk.common.get_extended_positions()`
* `stk.common.get_vertical_length()`
* `stk.common.get_wrapped_coordinates()`
* `stk.common.select_index()`
6 changes: 5 additions & 1 deletion structuretoolkit/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@
get_wrapped_coordinates,
select_index,
)
from structuretoolkit.common.pymatgen import ase_to_pymatgen, pymatgen_to_ase
from structuretoolkit.common.pymatgen import (
ase_to_pymatgen,
pymatgen_read_from_file,
pymatgen_to_ase,
)
from structuretoolkit.common.pyscal import ase_to_pyscal
6 changes: 6 additions & 0 deletions structuretoolkit/common/pymatgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ def pymatgen_to_ase(structure):

adapter = AseAtomsAdaptor()
return adapter.get_atoms(structure=structure)


def pymatgen_read_from_file(*args, **kwargs):
from pymatgen.core import Structure

return pymatgen_to_ase(structure=Structure.from_file(*args, **kwargs))