|
29 | 29 | OxidationStateDecorationTransformation,
|
30 | 30 | OxidationStateRemovalTransformation,
|
31 | 31 | PartialRemoveSpecieTransformation,
|
| 32 | + RandomStructureTransformation, |
32 | 33 | PerturbStructureTransformation,
|
33 | 34 | PrimitiveCellTransformation,
|
34 | 35 | RemoveSpeciesTransformation,
|
@@ -320,6 +321,35 @@ def test_apply_transformations_best_first(self):
|
320 | 321 | assert len(trafo.apply_transformation(struct)) == 26
|
321 | 322 |
|
322 | 323 |
|
| 324 | +class TestRandomStructureTransformation(unittest.TestCase): |
| 325 | + def test_apply_transformation(self): |
| 326 | + trafo = RandomStructureTransformation() |
| 327 | + coords = [] |
| 328 | + coords.append([0, 0, 0]) |
| 329 | + coords.append([0.25, 0.25, 0.25]) |
| 330 | + lattice = Lattice( |
| 331 | + [ |
| 332 | + [3.521253, 0.000000, 2.032996], |
| 333 | + [1.173751, 3.319869, 2.032996], |
| 334 | + [0.000000, 0.000000, 4.065993] |
| 335 | + ] |
| 336 | + ) |
| 337 | + |
| 338 | + struct = Structure( |
| 339 | + lattice, |
| 340 | + [ |
| 341 | + {"Ga3+": 0.5, "In3+": 0.5}, |
| 342 | + {"As3-": 0.5, "P3-": 0.5} |
| 343 | + ], |
| 344 | + coords) |
| 345 | + |
| 346 | + struct.make_supercell([3, 3, 3]) |
| 347 | + |
| 348 | + output = trafo.apply_transformation(struct, n_copies=5) |
| 349 | + assert len(output) == 5 |
| 350 | + assert isinstance(output[0], Structure) |
| 351 | + |
| 352 | + |
323 | 353 | class TestOrderDisorderedStructureTransformation(unittest.TestCase):
|
324 | 354 | def test_apply_transformation(self):
|
325 | 355 | trafo = OrderDisorderedStructureTransformation()
|
|
0 commit comments