From 5696337ce70bee87520b98fa5eebbcc177c96da7 Mon Sep 17 00:00:00 2001 From: "Adam Ginsburg (keflavich)" Date: Tue, 18 Oct 2016 12:49:25 -0600 Subject: [PATCH 1/6] pyregion regions don't have units --- pvextractor/pvregions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvextractor/pvregions.py b/pvextractor/pvregions.py index 49fddd59a2..e929b439bc 100644 --- a/pvextractor/pvregions.py +++ b/pvextractor/pvregions.py @@ -105,9 +105,9 @@ def line_to_path(region): for x in region.coord_list: if l is None: - l = x.to(u.deg).value + l = x else: - b = x.to(u.deg).value + b = x if l is not None and b is not None: endpoints.append((l,b)) l,b = None,None From 1993e29cc720cb5370605601202f7125758cd496 Mon Sep 17 00:00:00 2001 From: "Adam Ginsburg (keflavich)" Date: Wed, 2 Nov 2016 10:59:42 -0600 Subject: [PATCH 2/6] apparently there are two different ways regions can be read --- pvextractor/pvregions.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pvextractor/pvregions.py b/pvextractor/pvregions.py index e929b439bc..36f2117430 100644 --- a/pvextractor/pvregions.py +++ b/pvextractor/pvregions.py @@ -105,9 +105,15 @@ def line_to_path(region): for x in region.coord_list: if l is None: - l = x + if hasattr(l,'unit'): + l = x.to(u.deg).value + else: + l = x else: - b = x + if hasattr(b,'unit'): + b = x.to(u.deg).value + else: + b = x if l is not None and b is not None: endpoints.append((l,b)) l,b = None,None From 59a79438f028a569f6bd2d9b466ae9122ce856ac Mon Sep 17 00:00:00 2001 From: "Adam Ginsburg (keflavich)" Date: Wed, 2 Nov 2016 12:08:25 -0600 Subject: [PATCH 3/6] wrong variable name --- pvextractor/pvregions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pvextractor/pvregions.py b/pvextractor/pvregions.py index 36f2117430..c94d4a3049 100644 --- a/pvextractor/pvregions.py +++ b/pvextractor/pvregions.py @@ -105,16 +105,18 @@ def line_to_path(region): for x in region.coord_list: if l is None: - if hasattr(l,'unit'): + if hasattr(x,'unit'): l = x.to(u.deg).value else: l = x else: - if hasattr(b,'unit'): + if hasattr(x,'unit'): b = x.to(u.deg).value else: b = x if l is not None and b is not None: + if hasattr(b,'unit') or hasattr(l,'unit'): + raise TypeError("Can't work with a list of quantities") endpoints.append((l,b)) l,b = None,None else: From ff2387f78203e01af0c886f8b7b238766765c9a1 Mon Sep 17 00:00:00 2001 From: "Adam Ginsburg (keflavich)" Date: Wed, 2 Nov 2016 12:41:05 -0600 Subject: [PATCH 4/6] try installing pyqt4 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 83d71c6be9..d0103816f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,6 +50,7 @@ matrix: before_install: - git clone git://github.com/astropy/ci-helpers.git - source ci-helpers/travis/setup_conda_$TRAVIS_OS_NAME.sh + - conda install pyqt4 script: - python setup.py $SETUP_CMD From a8ce0d9348b8294301c799ec284047ac93d16fb6 Mon Sep 17 00:00:00 2001 From: "Adam Ginsburg (keflavich)" Date: Wed, 2 Nov 2016 12:51:02 -0600 Subject: [PATCH 5/6] pyqt, not pyqt4 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d0103816f8..480e643c72 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,7 +50,7 @@ matrix: before_install: - git clone git://github.com/astropy/ci-helpers.git - source ci-helpers/travis/setup_conda_$TRAVIS_OS_NAME.sh - - conda install pyqt4 + - conda install pyqt script: - python setup.py $SETUP_CMD From c6068f31711b773952cfc3a4ecda493ee3c82e7d Mon Sep 17 00:00:00 2001 From: "Adam Ginsburg (keflavich)" Date: Fri, 4 Nov 2016 14:05:10 -0600 Subject: [PATCH 6/6] install qt 4 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 480e643c72..e3c4c2bda1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,7 +50,7 @@ matrix: before_install: - git clone git://github.com/astropy/ci-helpers.git - source ci-helpers/travis/setup_conda_$TRAVIS_OS_NAME.sh - - conda install pyqt + - conda install pyqt=4 script: - python setup.py $SETUP_CMD