Skip to content

Commit

Permalink
removes deprecation warning in phtracker
Browse files Browse the repository at this point in the history
  • Loading branch information
AymericPCLegros committed May 22, 2024
1 parent ea4e1e3 commit 588402f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mpisppy/extensions/phtracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ def add_row(self, row):
self.seen_iters.add(row_iter)
# since append is deprecated
new_dict = pd.DataFrame([row], columns=self.columns)
self.df = pd.concat([self.df, new_dict], ignore_index=True)
if len(self.df) == 0:
self.df = new_dict
else:
self.df = pd.concat([self.df, new_dict], ignore_index=True)

def write_out_data(self):
""" Write out the cached data to csv file and clear the cache
Expand Down

0 comments on commit 588402f

Please sign in to comment.