Skip to content

Commit

Permalink
Switch getPackageDir exception to LookupError
Browse files Browse the repository at this point in the history
instead of pex_exceptions
  • Loading branch information
timj committed Sep 15, 2021
1 parent 3402376 commit 100312b
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 14 deletions.
3 changes: 1 addition & 2 deletions config/hsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
# 'config' is a SourceMeasurementConfig.
import os.path
from lsst.utils import getPackageDir
from lsst.pex.exceptions.wrappers import NotFoundError

try:
config.load(os.path.join(getPackageDir("meas_extensions_shapeHSM"), "config", "enable.py"))
config.plugins["ext_shapeHSM_HsmShapeRegauss"].deblendNChild = "deblend_nChild"
# Enable debiased moments
config.plugins.names |= ["ext_shapeHSM_HsmPsfMomentsDebiased"]
except NotFoundError as e:
except LookupError as e:
print("Cannot enable shapeHSM (%s): disabling HSM shape measurements" % (e,))
3 changes: 1 addition & 2 deletions tests/nopytest_test_processCcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import lsst.utils.tests
import lsst.afw.image as afwImage
import lsst.geom as geom
import lsst.pex.exceptions as pexExcept
from lsst.pipe.tasks.processCcd import ProcessCcdTask
from lsst.utils import getPackageDir
from lsst.base import disableImplicitThreading
Expand All @@ -44,7 +43,7 @@ def setUpClass(cls):
"""Runs ProcessCcdTask so the test* methods can inspect the results."""
try:
cls.datadir = getPackageDir("testdata_decam")
except pexExcept.NotFoundError:
except LookupError:
message = "testdata_decam not setup. Skipping."
warnings.warn(message)
raise unittest.SkipTest(message)
Expand Down
3 changes: 1 addition & 2 deletions tests/test_butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import warnings

import lsst.daf.persistence as dafPersist
import lsst.pex.exceptions as pexExcept
import lsst.utils.tests
from lsst.ip.isr import Linearizer, LinearizeLookupTable
from lsst.utils import getPackageDir
Expand All @@ -37,7 +36,7 @@ class ButlerTestCase(unittest.TestCase):
def setUp(self):
try:
datadir = getPackageDir("testdata_decam")
except pexExcept.NotFoundError:
except LookupError:
message = "testdata_decam not setup. Skipping."
warnings.warn(message)
raise unittest.SkipTest(message)
Expand Down
3 changes: 1 addition & 2 deletions tests/test_crosstalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import lsst.utils.tests

from lsst.utils import getPackageDir
import lsst.pex.exceptions as pexExcept
import lsst.geom as geom
import lsst.daf.persistence as dafPersist
from lsst.ip.isr.isrTask import IsrTask
Expand Down Expand Up @@ -55,7 +54,7 @@ class CrosstalkTestCase(lsst.utils.tests.TestCase):
def setUp(self):
try:
datadir = getPackageDir('testdata_decam')
except pexExcept.NotFoundError:
except LookupError:
message = "testdata_decam not setup. Skipping."
warnings.warn(message)
raise unittest.SkipTest(message)
Expand Down
3 changes: 1 addition & 2 deletions tests/test_getInstcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import lsst.utils.tests
from lsst.utils import getPackageDir

import lsst.pex.exceptions as pexExcept
import lsst.daf.persistence as dafPersist
from lsst.geom import arcseconds, radians

Expand All @@ -40,7 +39,7 @@ class GetInstcalTestCase(lsst.utils.tests.TestCase):
def setUp(self):
try:
datadir = getPackageDir("testdata_decam")
except pexExcept.NotFoundError:
except LookupError:
message = "testdata_decam not setup. Skipping."
warnings.warn(message)
raise unittest.SkipTest(message)
Expand Down
3 changes: 1 addition & 2 deletions tests/test_getRaw.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import lsst.utils.tests
from lsst.utils import getPackageDir

import lsst.pex.exceptions as pexExcept
import lsst.daf.persistence as dafPersist
from lsst.afw.image import RotType
from lsst.geom import degrees, radians, arcseconds, SpherePoint
Expand Down Expand Up @@ -62,7 +61,7 @@ class GetRawTestCase(lsst.utils.tests.TestCase):
def setUp(self):
try:
datadir = getPackageDir("testdata_decam")
except pexExcept.NotFoundError:
except LookupError:
message = "testdata_decam not setup. Skipping."
warnings.warn(message)
raise unittest.SkipTest(message)
Expand Down
3 changes: 1 addition & 2 deletions tests/test_wcsCards.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import lsst.utils.tests

import lsst.daf.persistence as dafPersist
import lsst.pex.exceptions as pexExcept


class WcsCardsTestCase(lsst.utils.tests.TestCase):
Expand All @@ -37,7 +36,7 @@ class WcsCardsTestCase(lsst.utils.tests.TestCase):
def setUp(self):
try:
datadir = getPackageDir("testdata_decam")
except pexExcept.NotFoundError:
except LookupError:
message = "testdata_decam not setup. Skipping."
warnings.warn(message)
raise unittest.SkipTest(message)
Expand Down

0 comments on commit 100312b

Please sign in to comment.