From 81cfb1aef31ddc38a27a47837bb435ffd39b89cd Mon Sep 17 00:00:00 2001 From: nmearl Date: Tue, 1 Aug 2017 11:55:27 -0400 Subject: [PATCH 1/4] Fix path issue causing errors instead of exceptions --- mosviz/loaders/loader_selection.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mosviz/loaders/loader_selection.py b/mosviz/loaders/loader_selection.py index b52be55..03b2c2a 100644 --- a/mosviz/loaders/loader_selection.py +++ b/mosviz/loaders/loader_selection.py @@ -194,12 +194,15 @@ def _validation_checks(self, *args, **kwargs): filenames = self.data.get_component(column_name).labels try: - loader(filenames[0]) - except Exception as e: + path = os.sep.join( + self.data._load_log.path.split(os.sep)[:-1]) + file_path = os.path.join(path, filenames[0]) + loader(file_path) + except: self.validate(False, "An error occurred when trying to read in " "'{0}' using the loader '{1}' (see terminal for " "the full error).".format(filenames[0], loader_name)) - print(e) + raise self.validate(True, "All spectra and cutout files exist and the loaders " "are able to read in the first one of each.") From 18ad0660d465eb3a341bec217dd1c22602bf3e15 Mon Sep 17 00:00:00 2001 From: nmearl Date: Tue, 1 Aug 2017 12:59:03 -0400 Subject: [PATCH 2/4] Reserve the try/except block for loaders only --- mosviz/loaders/loader_selection.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mosviz/loaders/loader_selection.py b/mosviz/loaders/loader_selection.py index 03b2c2a..6daf20b 100644 --- a/mosviz/loaders/loader_selection.py +++ b/mosviz/loaders/loader_selection.py @@ -193,10 +193,11 @@ def _validation_checks(self, *args, **kwargs): column_name = getattr(self, column) filenames = self.data.get_component(column_name).labels + path = os.sep.join( + self.data._load_log.path.split(os.sep)[:-1]) + file_path = os.path.join(path, filenames[0]) + try: - path = os.sep.join( - self.data._load_log.path.split(os.sep)[:-1]) - file_path = os.path.join(path, filenames[0]) loader(file_path) except: self.validate(False, "An error occurred when trying to read in " From 8d39236815a0430e13898983b6bea58f9aaa5090 Mon Sep 17 00:00:00 2001 From: nmearl Date: Fri, 27 Oct 2017 10:03:10 -0400 Subject: [PATCH 3/4] Pin sphinx version while building docs --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 88e109f..587cee2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,7 +78,7 @@ matrix: # Check for sphinx doc build warnings - we do this first because it # may run for a long time - os: linux - env: SETUP_CMD='build_docs -w' + env: SETUP_CMD='build_docs -w' SPHINX_VERSION='<1.6' # Now try Astropy dev and LTS vesions with the latest 3.x and 2.7. - os: linux From 0bc7cbce1021fb16c5b751f351e2eb619e2a683d Mon Sep 17 00:00:00 2001 From: nmearl Date: Fri, 27 Oct 2017 10:29:34 -0400 Subject: [PATCH 4/4] Remove python 2.x test with astropy dev version --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7346bfe..c985463 100644 --- a/.travis.yml +++ b/.travis.yml @@ -81,9 +81,6 @@ matrix: env: SETUP_CMD='build_docs -w' SPHINX_VERSION='<1.6' # Now try Astropy dev and LTS vesions with the latest 3.x and 2.7. - - os: linux - env: PYTHON_VERSION=2.7 ASTROPY_VERSION=development - EVENT_TYPE='pull_request push cron' - os: linux env: ASTROPY_VERSION=development EVENT_TYPE='pull_request push cron'