Skip to content

Commit 9bb1c2b

Browse files
committed
Fix Future Warning for real
1 parent 13e83e0 commit 9bb1c2b

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

compiler/base/vector.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,16 @@ class vector():
1111
concise vector operations, output, and other more complex
1212
data structures like lists.
1313
"""
14-
def __init__(self, x, y=None):
14+
def __init__(self, x, y=0):
1515
""" init function support two init method"""
1616
# will take single input as a coordinate
17-
if len(x)==2:
17+
if isinstance(x, (list,tuple,vector)):
1818
self.x = float(x[0])
1919
self.y = float(x[1])
2020
#will take two inputs as the values of a coordinate
21-
elif y:
21+
else:
2222
self.x = float(x)
2323
self.y = float(y)
24-
else:
25-
debug.error("Invalid vector specification.",-1)
2624

2725
def __str__(self):
2826
""" override print function output """

compiler/gdsMill/gdsMill/vlsiLayout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ def measureSizeInStructure(self,structure,cellBoundary):
620620
def updateBoundary(self,thisBoundary,cellBoundary):
621621
[left_bott_X,left_bott_Y,right_top_X,right_top_Y]=thisBoundary
622622
# If any are None
623-
if cellBoundary[0]==None or cellBoundary[1]==None or cellBoundary[2]==None or cellBoundary[3]==None:
623+
if not (cellBoundary[0] and cellBoundary[1] and cellBoundary[2] and cellBoundary[3]):
624624
cellBoundary=thisBoundary
625625
else:
626626
if cellBoundary[0]>left_bott_X:

0 commit comments

Comments
 (0)