Skip to content

Commit 41402ad

Browse files
Update shuffle_poscar feature in run.py (#1730)
numpy.random.Generator.shuffle() performs the intended operation of shuffling the order of atoms. numpy.random.Generator.permuted() permutes the elements along the given axis, which mixes the coordinates of all atoms shuffle ![shuffle](https://github.com/user-attachments/assets/ef814c7a-72b3-4d13-b6cc-1612a1fe6fc6) permuted ![permuted](https://github.com/user-attachments/assets/ea6e9be0-74e7-4e43-a008-0d65ec0839ee) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Improved the process that randomizes system coordinates when a specific option is enabled, enhancing internal data handling and consistency. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: ztzkz <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent efa1cad commit 41402ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dpgen/generator/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ def make_model_devi(iter_index, jdata, mdata):
13051305
type_map=jdata["type_map"],
13061306
)
13071307
if shuffle_poscar:
1308-
system.data["coords"] = rng.permuted(system.data["coords"], axis=1)
1308+
rng.shuffle(system.data["coords"], axis=1)
13091309
if jdata.get("model_devi_nopbc", False):
13101310
system.remove_pbc()
13111311
system.to_lammps_lmp(os.path.join(conf_path, lmp_name))

0 commit comments

Comments
 (0)