Skip to content

Commit

Permalink
proper fix for future warning on empty dfs
Browse files Browse the repository at this point in the history
  • Loading branch information
maurerle committed Sep 25, 2023
1 parent 8b17b3e commit 2aa152a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assume/common/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ async def store_dfs(self):
continue

# exclude all empty dataframes from self.write_dfs[table]
self.write_dfs[table] = [df for df in self.write_dfs[table] if not df.empty]
df = pd.concat(self.write_dfs[table], axis=0)

df.reset_index()
Expand Down Expand Up @@ -322,7 +321,8 @@ def write_market_dispatch(self, data):
"""
df = pd.DataFrame(data, columns=["datetime", "power", "market_id", "unit_id"])
df["simulation"] = self.simulation_id
self.write_dfs["market_dispatch"].append(df)
if not df.empty:
self.write_dfs["market_dispatch"].append(df)

def write_unit_dispatch(self, data):
"""
Expand Down

0 comments on commit 2aa152a

Please sign in to comment.