Skip to content

Commit ce3f2a5

Browse files
authored
Merge pull request #3 from SwolfPy-Project/Dev-New-Model
Revise LCI report method in LF
2 parents bb61627 + da7077f commit ce3f2a5

File tree

1 file changed

+13
-6
lines changed
  • swolfpy_processmodels

1 file changed

+13
-6
lines changed

swolfpy_processmodels/LF.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from swolfpy_inputdata import LF_Input
1111
import ast
1212
from pathlib import Path
13+
from copy import deepcopy
1314

1415
class LF(ProcessModel):
1516
Process_Type = 'Treatment'
@@ -396,13 +397,13 @@ def report(self):
396397
# Check the electricity production
397398
if LCI_DF['Electricity_production'].values.sum() > 0:
398399
LCI_DF['Electricity_production'] = (
399-
LCI_DF['Electricity_production']
400-
- LCI_DF['Electricity_consumption'])
400+
LCI_DF['Electricity_production'].values
401+
- LCI_DF['Electricity_consumption'].values)
401402
LCI_DF['Electricity_consumption'] = 0
402403
else:
403404
LCI_DF['Electricity_consumption'] = (
404-
LCI_DF['Electricity_consumption']
405-
- LCI_DF['Electricity_production'])
405+
LCI_DF['Electricity_consumption'].values
406+
- LCI_DF['Electricity_production'].values)
406407
LCI_DF['Electricity_production'] = 0
407408

408409
for y in self.Index:
@@ -466,7 +467,13 @@ def add(self,name,flow):
466467
self.LCI[:,self.ColDict[name]]+=flow
467468

468469
def report(self):
469-
return(pd.DataFrame(self.LCI[:,:len(self.ColDict)],columns=list(self.ColDict.keys()),index=self.Index))
470+
LCI = deepcopy(self.LCI)
471+
return pd.DataFrame(LCI[:,:len(self.ColDict)],
472+
columns=list(self.ColDict.keys()),
473+
index=self.Index)
470474

471475
def report_T(self):
472-
return(pd.DataFrame(self.LCI[:,:len(self.ColDict)].transpose(),index=list(self.ColDict.keys()),columns=self.Index))
476+
LCI = deepcopy(self.LCI)
477+
return pd.DataFrame(LCI[:,:len(self.ColDict)].transpose(),
478+
index=list(self.ColDict.keys()),
479+
columns=self.Index)

0 commit comments

Comments
 (0)