Skip to content

Fix warning in CoordFile.displaceFixedBackBone()

Calling CoordFile.displaceFixedBackBone() gives warning

/home/jonas/anaconda3/lib/python3.9/site-packages/pandas/core/indexing.py:1797: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  self._setitem_single_column(loc, v, pi)

This is caused by manipulating a copy of the self.coordinates data frame. Warning is bullshit in this case, because I update self.coordinates with the changes in the copy.

If I have some time, I can figure out how to do this the proper way. There is propably a way of doing this without copying and updating the data frame.