Closed jmhow119 closed 7 years ago
This is not a bug. make_supercell actually modifies the structure in place. For the non-working codes, you are effectively iteratively building larger and larger supercells within the same structure. That is why it never completes. The last example you wrote actually recreates the structure before making a supercell, which is why it works. If you want to use the first two examples, you need to do
new_structure = wurzite_structure.copy()
Just simply doing the assigning only creates a reference to the original structure. Please consult Python's documentation about passing by reference.
thank you for the reminder on pass by reference (or call-by-object more precisely). I haven't dealt with this specific case of passing objects by reference in awhile.
System
Summary
Example code
This will not complete:
This will not complete:
This will:
Suggested solution (if any)
Files (if any)
This file was downloaded from the materials explorer