From bc90be64e36bc80a628d6beca293841f02240c2e Mon Sep 17 00:00:00 2001 From: snail123815 Date: Wed, 29 Jun 2022 09:50:48 +0200 Subject: [PATCH] correct WidthHeight position error --- funcs/parseMetadata.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/funcs/parseMetadata.py b/funcs/parseMetadata.py index 492e0c2..8dd9dae 100644 --- a/funcs/parseMetadata.py +++ b/funcs/parseMetadata.py @@ -100,7 +100,9 @@ def getPositions(positionTsvPath): posDict[locType] = {} # remove padding deal here, only allowing 'WidthHeight' and 'TwoPositions' if locType == 'removePadding': - assert pLocType in ['TwoPositions', 'WidthHeight'], f'Please set padding position under "WidthHeight" and "TwoPositions", now it is under "{pLocType}"' + assert pLocType in ['TwoPositions', 'WidthHeight'], \ + 'Please set padding position under "WidthHeight" and "TwoPositions",' + \ + f' now it is under "{pLocType}"' position = [int(elem) for elem in elements[1:]] # already obey rule of "TwoPositions" if pLocType == 'WidthHeight': @@ -129,7 +131,7 @@ def getPositions(positionTsvPath): r = int(position[2] / 2) position = [x - r for x in position[:2]] + [x + r for x in position[:2]] elif locType == 'WidthHeight': - position = position[:2] + [sum(x) for x in zip(position[2:], position[2:4])] + position = position[:2] + [sum(x) for x in zip(position[:2], position[2:4])] elif locType == 'TwoPositions': position = position[:4] posDict[locType][posName] = position