Skip to content

Commit

Permalink
Update resilientCommunity.py
Browse files Browse the repository at this point in the history
updated addEquipmentInfoToOmd code
  • Loading branch information
DavidArmahJr authored Apr 9, 2024
1 parent 1fbf0c9 commit 935d6cb
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions omf/models/resilientCommunity.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,26 +882,28 @@ def addLoadInfoToOmd(loadsDict, omdDict):
return omdDict


def addEquipmentInfoToOmd(obDict, omdDict):
def addEquipmentInfoToOmd(obDict, omdDict, equipList):
'''
adds criticality values to omd file for all objects
loadsDict -> dict of loads
omdDict -> dict of omd objects
returns new dict of omd objects
'''
for ob in omdDict.get('tree', {}).values():
obType = ob['object']
obName = ob['name']
k = obType + '.' + obName

bcs_score = obDict[k]['base crit score']
ccs_score = obDict[k]['community crit score']
bcs_index = obDict[k]['base crit score']
ccs_index = obDict[k]['community crit index']
ob['base crit score'] = bcs_score
ob['community crit score'] = ccs_score
ob['community crit index'] = ccs_index
ob['base crit index'] = bcs_index
if (ob['object'] in equipList):
obType = ob['object']
obName = ob['name']
k = obType + '.' + obName
bcs_score = obDict[k]['base crit score']
ccs_score = obDict[k]['community crit score']
bcs_index = obDict[k]['base crit score']
ccs_index = obDict[k]['community crit index']
ob['base crit score'] = bcs_score
ob['community crit score'] = ccs_score
ob['community crit index'] = ccs_index
ob['base crit index'] = bcs_index
else:
continue
return omdDict


Expand Down

0 comments on commit 935d6cb

Please sign in to comment.