Skip to content

Commit

Permalink
Use get_global_number_of_atoms() instead (#1256)
Browse files Browse the repository at this point in the history
```
/opt/hostedtoolcache/Python/3.9.17/x64/lib/python3.9/site-packages/ase/atoms.py:967: VisibleDeprecationWarning: Use get_global_number_of_atoms() instead
```
  • Loading branch information
njzjz committed Jun 25, 2023
1 parent 6675739 commit 52b40f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions dpgen/data/tools/create_random_disturb.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def create_disturbs_ase(

# read-in by ase
atoms = ase.io.read(fin)
natoms = atoms.get_number_of_atoms()
natoms = atoms.get_global_number_of_atoms()
pos0 = atoms.get_positions()

# creat nfile ofmt files.
Expand Down Expand Up @@ -119,7 +119,7 @@ def create_disturbs_ase_dev(

# read-in by ase
atoms = ase.io.read(fin)
natoms = atoms.get_number_of_atoms()
natoms = atoms.get_global_number_of_atoms()
cell0 = atoms.get_cell()

# creat nfile ofmt files.
Expand Down Expand Up @@ -186,7 +186,7 @@ def create_disturbs_abacus_dev(

# read-in by ase
# atoms = ase.io.read(fin)
# natoms = atoms.get_number_of_atoms()
# natoms = atoms.get_global_number_of_atoms()
# cell0 = atoms.get_cell()

stru = get_abacus_STRU(fin)
Expand Down
2 changes: 1 addition & 1 deletion dpgen/data/tools/io_lammps.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def ase2lammpsdata(atoms, typeids=None, fout="out.lmp"):
fw.write("\n")

# write number of atoms
natoms = atoms.get_number_of_atoms()
natoms = atoms.get_global_number_of_atoms()
fw.write("%d atoms\n" % natoms)
fw.write("\n")

Expand Down

0 comments on commit 52b40f9

Please sign in to comment.