Skip to content

Commit

Permalink
fix function def
Browse files Browse the repository at this point in the history
dpinney committed Dec 9, 2023
1 parent 52df4a5 commit 4a6c32e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions omf/models/resilientDist.py
Original file line number Diff line number Diff line change
@@ -120,11 +120,10 @@ def changeCellSize(self, cellSize):
''' Scale the cell size in image plot. '''
self.hazardObj["cellsize"] = cellSize

def mapValue(self, value, fromMin, fromMax, toMin=.7, toMax=1):
newValue = float(value - fromMin) / float(fromMax-fromMin)
return toMin + (newValue * (toMax-toMin))

def mapRanges(self, values, fromMin, fromMax):
def mapValue(self, value, fromMin, fromMax, toMin=.7, toMax=1):
newValue = float(value - fromMin) / float(fromMax-fromMin)
return toMin + (newValue * (toMax-toMin))
newValues = []
for value in values:
newValues.append(mapValue(value, fromMin, fromMax))

0 comments on commit 4a6c32e

Please sign in to comment.