From ff56a96843e10ed99a21f8bcab9213f9eef3f4cd Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Thu, 11 Oct 2018 13:30:21 -0700 Subject: [PATCH] Fixes to dump all Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> Signed-off-by: Tim 'mithro' Ansell --- prjxray/lib.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/prjxray/lib.py b/prjxray/lib.py index 208c46b2..f0a9d774 100644 --- a/prjxray/lib.py +++ b/prjxray/lib.py @@ -188,16 +188,16 @@ def find_origin_coordinate(site_names): smallest coordinate to re-origin them all to be relative to the tile. """ - if len(site_names) == 0: + x_coords = [] + y_coords = [] + for site in site_names: + x_coord, y_coord = get_site_coordinate_from_name(site) + x_coords.append(x_coord) + y_coords.append(y_coord) + + if len(x_coords) == 0 or len(y_coords) == 0: return 0, 0 - def inner_(): - for site in site_names: - coordinate = get_site_coordinate_from_name(site) - - yield coordinate.x_coord, coordinate.y_coord - - x_coords, y_coords = zip(*inner_()) min_x_coord = min(x_coords) min_y_coord = min(y_coords)