pymatgen icon indicating copy to clipboard operation
pymatgen copied to clipboard

LAMMPS IO: update to accomodate pandas deprecation

Open rkingsbury opened this issue 2 years ago • 3 comments

Describe the bug Several lines in pymatgen.io.lammps.data.py make use of the pandas DataFrame.append method, which is being deprecated, causing many warnings along the lines of:

/Users/ryan/miniconda3/envs/md/code/pymatgen/pymatgen/io/lammps/data.py:1283: 
FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. 
Use pandas.concat instead.
  self.atoms = self.atoms.append(atoms_df, ignore_index=True)
/Users/ryan/miniconda3/envs/md/code/pymatgen/pymatgen/io/lammps/data.py:1307: 
FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. 
Use pandas.concat instead.
  self.topology[kw] = self.topology[kw].append(topo_df, ignore_index=True)

when creating CombinedData objects. These calls should be replaced with pd.concat as directed by the warning. Note that there may be other instances of DataFrame.append beyond the two lines referenced - these are just two that I encountered in my work recently.

rkingsbury avatar Apr 28 '22 13:04 rkingsbury

Thanks. Go ahead and submit a PR to fix this.

shyuep avatar Apr 28 '22 15:04 shyuep

@manaslkht would you be able to tackle this?

rkingsbury avatar May 23 '22 14:05 rkingsbury

@rkingsbury Yes, will get this done by this weekend.

manaslkht avatar May 24 '22 11:05 manaslkht