Skip to content

Commit

Permalink
:')
Browse files Browse the repository at this point in the history
  • Loading branch information
kedhammar committed Dec 15, 2023
1 parent d15baef commit b97e3f1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/zika_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,21 @@ def format_worklist(df, deck):
# As long as the transfer volume of the current row exceeds twice the max
while row.transfer_vol > 2 * max_vol:
# Add a max-volume sub-transfer and deduct the same volume from the current row
transfers_to_add = pd.concat(transfers_to_add, max_vol_transfer)
transfers_to_add = pd.concat([transfers_to_add, max_vol_transfer])
row.transfer_vol -= max_vol

# The remaining volume is higher than the max but lower than twice the max. Split this volume across two transfers.
final_split = row.copy()
final_split.loc["transfer_vol"] = round(row.transfer_vol / 2)
transfers_to_add = pd.concat(transfers_to_add, final_split)
transfers_to_add = pd.concat([transfers_to_add, final_split])
row.transfer_vol -= final_split["transfer_vol"]

# Append all the resolved sub-transfers and what remains of the original row to the new df
df_split = pd.concat(df_split, transfers_to_add)
df_split = pd.concat(df_split, row)
df_split = pd.concat([df_split, transfers_to_add])
df_split = pd.concat([df_split, row])

else:
df_split = pd.concat(df_split, row)
df_split = pd.concat([df_split, row])

df_split.sort_index(inplace=True)
df_split.reset_index(inplace=True, drop=True)
Expand Down

0 comments on commit b97e3f1

Please sign in to comment.