From 9bb1c2bbcf43626a304d5ced495347ea999e8e45 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Wed, 10 Oct 2018 15:58:16 -0700 Subject: [PATCH] Fix Future Warning for real --- compiler/base/vector.py | 8 +++----- compiler/gdsMill/gdsMill/vlsiLayout.py | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/compiler/base/vector.py b/compiler/base/vector.py index 6533e09e..6069a1ab 100644 --- a/compiler/base/vector.py +++ b/compiler/base/vector.py @@ -11,18 +11,16 @@ class vector(): concise vector operations, output, and other more complex data structures like lists. """ - def __init__(self, x, y=None): + def __init__(self, x, y=0): """ init function support two init method""" # will take single input as a coordinate - if len(x)==2: + if isinstance(x, (list,tuple,vector)): self.x = float(x[0]) self.y = float(x[1]) #will take two inputs as the values of a coordinate - elif y: + else: self.x = float(x) self.y = float(y) - else: - debug.error("Invalid vector specification.",-1) def __str__(self): """ override print function output """ diff --git a/compiler/gdsMill/gdsMill/vlsiLayout.py b/compiler/gdsMill/gdsMill/vlsiLayout.py index f3ce204c..ea20a276 100644 --- a/compiler/gdsMill/gdsMill/vlsiLayout.py +++ b/compiler/gdsMill/gdsMill/vlsiLayout.py @@ -620,7 +620,7 @@ class VlsiLayout: def updateBoundary(self,thisBoundary,cellBoundary): [left_bott_X,left_bott_Y,right_top_X,right_top_Y]=thisBoundary # If any are None - if cellBoundary[0]==None or cellBoundary[1]==None or cellBoundary[2]==None or cellBoundary[3]==None: + if not (cellBoundary[0] and cellBoundary[1] and cellBoundary[2] and cellBoundary[3]): cellBoundary=thisBoundary else: if cellBoundary[0]>left_bott_X: