Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions API/Classes/Case/ImportTemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ def importProcess(self, data):
if not techsArray:
techs.append(self.defaultTech('TEC_0', first=True)[0])
else:
for obj in techsArray:
for i, obj in enumerate(techsArray):
tech = obj['TECHNOLOGY']
if obj.get('DESCRIPTION') is not None:
desc = obj['DESCRIPTION']
Expand All @@ -641,7 +641,7 @@ def importProcess(self, data):
else:
unitact = "PJ"

if obj==0:
if i==0:
techs.append(self.defaultTech(tech, desc, unitcap, unitact, first=True)[0])
else:
techs.append(self.defaultTech(tech, desc, unitcap, unitact)[0])
Expand All @@ -650,7 +650,7 @@ def importProcess(self, data):
if not commsArray:
comms.append(self.defaultComm('COM_0', first=True)[0])
else:
for obj in commsArray:
for i, obj in enumerate(commsArray):
com = obj['COMMODITY']
if obj.get('DESCRIPTION') is not None:
desc = obj['DESCRIPTION']
Expand All @@ -660,7 +660,7 @@ def importProcess(self, data):
unit = obj['UNIT']
else:
unit = "PJ"
if obj==0:
if i==0:
comms.append(self.defaultComm(com, desc, unit, True)[0])
else:
comms.append(self.defaultComm(com, desc, unit)[0])
Expand All @@ -669,7 +669,7 @@ def importProcess(self, data):
if not emisArray:
emis.append(self.defaultEmi('EMI_0', first=True)[0])
else:
for obj in emisArray:
for i, obj in enumerate(emisArray):
emi = obj['EMISSION']
if obj.get('DESCRIPTION') is not None:
desc = obj['DESCRIPTION']
Expand All @@ -679,7 +679,7 @@ def importProcess(self, data):
unit = obj['UNIT']
else:
unit = "Ton"
if obj==0:
if i==0:
emis.append(self.defaultEmi(emi, desc, unit, True)[0])
else:
emis.append(self.defaultEmi(emi, desc, unit)[0])
Expand All @@ -690,7 +690,7 @@ def importProcess(self, data):
# stgs.append(self.defaultStg('STG_0', first=True)[0])
# else:
if stgsArray:
for obj in stgsArray:
for i, obj in enumerate(stgsArray):
stg = obj['STORAGE']
if obj.get('DESCRIPTION') is not None:
desc = obj['DESCRIPTION']
Expand All @@ -700,7 +700,7 @@ def importProcess(self, data):
unit = obj['UNIT']
else:
unit = "MW"
if obj==0:
if i==0:
stgs.append(self.defaultStg(stg, desc, unit, True)[0])
else:
stgs.append(self.defaultStg(stg, desc, unit)[0])
Expand Down
Loading