atomlib.io
FileType
module-attribute
FileType: TypeAlias = Literal[
"cif", "xyz", "xsf", "cfg", "lmp", "mslice", "qe"
]
CIF
dataclass
Source code in atomlib/io/cif.py
from_file
staticmethod
from_file(file: FileOrPath) -> CIF
get_block
get_block(block: Union[int, str]) -> CIFDataBlock
Source code in atomlib/io/cif.py
XYZ
dataclass
Source code in atomlib/io/xyz.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
|
from_atoms
staticmethod
Source code in atomlib/io/xyz.py
from_file
staticmethod
from_file(file: FileOrPath) -> XYZ
Source code in atomlib/io/xyz.py
write
write(file: FileOrPath, fmt: XYZFormat = 'exyz')
Source code in atomlib/io/xyz.py
cell_matrix
Source code in atomlib/io/xyz.py
pbc
Source code in atomlib/io/xyz.py
XSF
dataclass
Source code in atomlib/io/xsf.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
|
primitive_cell
class-attribute
instance-attribute
primitive_cell: Optional[LinearTransform3D] = None
conventional_cell
class-attribute
instance-attribute
conventional_cell: Optional[LinearTransform3D] = None
get_atoms
Source code in atomlib/io/xsf.py
get_pbc
from_atoms
staticmethod
from_file
staticmethod
from_file(file: FileOrPath) -> XSF
write
write(path: FileOrPath)
Source code in atomlib/io/xsf.py
CFG
dataclass
Source code in atomlib/io/cfg.py
from_file
staticmethod
from_file(file: FileOrPath) -> CFG
from_atoms
staticmethod
Source code in atomlib/io/cfg.py
write
write(file: FileOrPath)
Source code in atomlib/io/cfg.py
LMP
dataclass
Source code in atomlib/io/lmp.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
|
get_cell
get_cell() -> Cell
Source code in atomlib/io/lmp.py
get_atoms
Source code in atomlib/io/lmp.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
|
from_atoms
staticmethod
Source code in atomlib/io/lmp.py
from_file
staticmethod
from_file(file: FileOrPath) -> LMP
write
write(file: FileOrPath)
Source code in atomlib/io/lmp.py
write_mslice
write_mslice(
cell: HasAtomCell,
f: BinaryFileOrPath,
template: Optional[MSliceFile] = None,
*,
slice_thickness: Optional[float] = None,
scan_points: Optional[ArrayLike] = None,
scan_extent: Optional[ArrayLike] = None,
noise_sigma: Optional[float] = None,
conv_angle: Optional[float] = None,
energy: Optional[float] = None,
defocus: Optional[float] = None,
tilt: Optional[Tuple[float, float]] = None,
tds: Optional[bool] = None,
n_cells: Optional[ArrayLike] = None
)
Write a structure to an mslice file. The structure must be orthogonal and aligned with the local coordinate system. It should be periodic in X and Y.
template
may be a file, path, or ElementTree containing an existing mslice file.
Its structure will be modified to make the final output. If not specified, a default
template will be used.
Additional options modify simulation properties. If an option is not specified, the template's properties are used.
Source code in atomlib/io/mslice.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
|
write_qe
write_qe(
atomcell: HasAtomCell,
f: FileOrPath,
pseudo: Optional[Mapping[str, str]] = None,
)
Write a structure to a Quantum Espresso pw.x file.
PARAMETER | DESCRIPTION |
---|---|
atomcell
|
Structure to write
TYPE:
|
f
|
File or path to write to
TYPE:
|
pseudo
|
Mapping from atom symbol |
Source code in atomlib/io/qe.py
read_cif
read_cif(
f: Union[FileOrPath, CIF, CIFDataBlock],
block: Union[int, str, None] = None,
) -> HasAtoms
Read a structure from a CIF file.
If block
is specified, read data from the given block of the CIF file (index or name).
Source code in atomlib/io/__init__.py
write_cif
write_cif(
atoms: Union[HasAtoms, CIF, CIFDataBlock], f: FileOrPath
)
Write a structure to an XSF file.
Source code in atomlib/io/__init__.py
read_xyz
read_xyz(f: Union[FileOrPath, XYZ]) -> HasAtoms
Read a structure from an XYZ file.
Source code in atomlib/io/__init__.py
write_xyz
write_xyz(
atoms: Union[HasAtoms, XYZ],
f: FileOrPath,
fmt: XYZFormat = "exyz",
)
read_xsf
read_xsf(f: Union[FileOrPath, XSF]) -> HasAtoms
Read a structure from a XSF file.
Source code in atomlib/io/__init__.py
write_xsf
write_xsf(atoms: Union[HasAtoms, XSF], f: FileOrPath)
Write a structure to an XSF file.
Source code in atomlib/io/__init__.py
read_cfg
read_cfg(f: Union[FileOrPath, CFG]) -> AtomCell
Read a structure from an AtomEye CFG file.
Source code in atomlib/io/__init__.py
write_cfg
write_cfg(atoms: Union[HasAtoms, CFG], f: FileOrPath)
read_lmp
read_lmp(
f: Union[FileOrPath, LMP],
type_map: Optional[Dict[int, Union[str, int]]] = None,
) -> AtomCell
Read a structure from a LAAMPS data file.
Source code in atomlib/io/__init__.py
write_lmp
write_lmp(atoms: Union[HasAtoms, LMP], f: FileOrPath)
read
read(path: FileOrPath, ty: FileType) -> HasAtoms
read(
path: FileOrPath, ty: Optional[FileType] = None
) -> HasAtoms
Read a structure from a file.
Currently, supported file types are 'cif', 'xyz', and 'xsf'.
If no ty
is specified, it is inferred from the file's extension.
Source code in atomlib/io/__init__.py
write
write(atoms: HasAtoms, path: FileOrPath, ty: FileType)
write(
atoms: HasAtoms,
path: FileOrPath,
ty: Optional[FileType] = None,
)
Write this structure to a file.
A file type may be specified using ty
.
If no ty
is specified, it is inferred from the path's extension.