Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed memory issue from metrics #178

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 4 additions & 6 deletions cymetric/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,11 @@ def materials(rsrcs, comps):
Resources times the massfrac in Compositions) indexed by the SimId, QualId,
ResourceId, ObjId, TimeCreated, and NucId.
"""
rsrcs = rsrcs[['SimId', 'ResourceId', 'ObjId', 'TimeCreated', 'Quantity',
'Units', 'QualId']]
x = pd.merge(rsrcs, comps, on=['SimId', 'QualId'], how='inner')
x = x.set_index(['SimId', 'QualId', 'ResourceId', 'ObjId', 'TimeCreated',
'NucId', 'Units'])
y = x['Quantity'] * x['MassFrac']
y.name = 'Mass'
z = y.reset_index()
return z
x['Mass'] = x['Quantity'] * x['MassFrac']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll need to "drop" [Quantity] and [MassFrac] column

return x


del _matdeps, _matschema
Expand Down