Structure
Bases: Structure
This class is a wraparound for Pymatgen's Structure class with additional properties and methods.
Source code in src/baderkit/toolkit/structure.py
20 21 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 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 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | |
equivalent_atoms
property
¶
Returns:
| Type | Description |
|---|---|
NDArray[int]
|
The equivalent atoms in the Structure. |
farthest_point
property
¶
Returns:
| Type | Description |
|---|---|
tuple(float, NDArray[float]
|
The maximum distance away from any atom in the system and the corresponding point. Note that generally this may be one point of several in systems with symmetry. |
labels
property
writable
¶
Returns:
| Type | Description |
|---|---|
list[str]
|
The list of labels for each site |
reduced_formula
property
¶
Returns:
| Type | Description |
|---|---|
str
|
The reduced formula of the structure. |
spacegroup_analyzer
property
¶
Returns:
| Type | Description |
|---|---|
SpacegroupAnalyzer
|
A spacegroup analyzer for this structure |
symmetry_data
property
¶
Returns:
| Type | Description |
|---|---|
TYPE
|
The pymatgen symmetry dataset for the Structure object |
symmetry_kwargs
property
writable
¶
Returns:
| Type | Description |
|---|---|
dict
|
The keyword arguments used in the SpaceGroupAnalyzer for finding symmetry data. |
get_cart_from_miller(h, k, l)
¶
Gets the cartesian coordinates of the vector perpendicular to the provided miller indices
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
int
|
First miller index. |
required |
k
|
int
|
Second miller index. |
required |
l
|
int
|
Third miller index. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float]
|
The cartesian coordinates of the vector perpendicular to the plane defined by the provided miller indices. |
Source code in src/baderkit/toolkit/structure.py
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 | |
insert(i, species, coords, coords_are_cartesian=False, validate_proximity=False, properties=None)
¶
Insert a site to the structure.
This is a wraparound for the PyMatGen method adding a label if it is not specified.
Args: i (int): Index to insert site species (species-like): Species of inserted site coords (3x1 array): Coordinates of inserted site coords_are_cartesian (bool): Whether coordinates are cartesian. Defaults to False. validate_proximity (bool): Whether to check if inserted site is too close to an existing site. Defaults to False. properties (dict): Properties associated with the site.
Returns: New structure with inserted site.
Source code in src/baderkit/toolkit/structure.py
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 | |
relabel_sites(ignore_uniq=False)
¶
This method is an exact copy of Pymatgen's. It is not available in some older version of pymatgen so I've added it to increase the dependency range.
Relabel sites to ensure they are unique.
Site labels are updated in-place, and relabeled by suffixing _1, _2, ..., _n for duplicates. Call Structure.copy().relabel_sites() to avoid modifying the original structure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ignore_uniq
|
bool
|
If True, do not relabel sites that already have unique labels. The default is False. |
False
|
Returns:
| Type | Description |
|---|---|
Self
|
Structure: self with relabeled sites. |
Source code in src/baderkit/toolkit/structure.py
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 | |
to(filename='', fmt='', **kwargs)
¶
Outputs the structure to a file or string.
Args: filename (str): If provided, output will be written to a file. If fmt is not specified, the format is determined from the filename. Defaults is None, i.e. string output. fmt (str): Format to output to. Defaults to JSON unless filename is provided. If fmt is specifies, it overrides whatever the filename is. Options include "cif", "poscar", "cssr", "json", "xsf", "mcsqs", "prismatic", "yaml", "fleur-inpgen". Non-case sensitive. **kwargs: Kwargs passthru to relevant methods. E.g., This allows the passing of parameters like symprec to the CifWriter.init method for generation of symmetric cifs.
Returns: (str) if filename is None. None otherwise.
Source code in src/baderkit/toolkit/structure.py
326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | |
to_plotter(**kwargs)
¶
Returns:
| Type | Description |
|---|---|
A GridPlotter object for visualization.
|
|
Source code in src/baderkit/toolkit/structure.py
357 358 359 360 361 362 363 364 365 366 367 | |