Skip to content

Commit

Permalink
waste pep updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nsryan2 committed Jul 26, 2024
1 parent 31ebb72 commit 9874680
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions scripts/waste.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,11 @@ def isotope_database(evaler, receivers, isotopes, commodities):
each time step.
"""

isotope_db = transactions_nuc_built_in(evaler=evaler,receivers=receivers, commodities=commodities, nucs=isotopes)
isotope_db = transactions_nuc_built_in(
evaler=evaler, receivers=receivers, commodities=commodities, nucs=isotopes)

# Create the dataframe and populate the columns for each isotope with zeros.
# Create the dataframe and populate the columns for each
# isotope with zeros.
isotope_df = evaler.eval('TimeList')
for nucid in isotopes:
isotope_df[nucid] = 0
Expand All @@ -140,13 +142,13 @@ def isotope_database(evaler, receivers, isotopes, commodities):
# Track the mass of each isotope stored at each time.
for transaction in range(len(isotope_db)):
for nucid in isotopes:
if isotope_db.loc[transaction,'NucId'] == int(nucid):
mass = isotope_db.loc[transaction,'Mass']
time_step = isotope_db.loc[transaction,'Time']
isotope_df.loc[str(time_step),str(nucid)] = mass
if isotope_db.loc[transaction, 'NucId'] == int(nucid):
mass = isotope_db.loc[transaction, 'Mass']
time_step = isotope_db.loc[transaction, 'Time']
isotope_df.loc[str(time_step), str(nucid)] = mass

# Add up the totals for each isotope over time.
for nucid in isotopes:
isotope_df[f'{nucid}_total'] = isotope_df[nucid].cumsum()

return isotope_df
return isotope_df

0 comments on commit 9874680

Please sign in to comment.