Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-26326: Remove obs dependency from ap_verify_testdata and ap_pipe_testdata #115

Merged
merged 1 commit into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion python/lsst/ap/verify/testUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ class DataTestCase(lsst.utils.tests.TestCase):
testDataset = 'ap_verify_testdata'
"""The EUPS package name of the dataset to use for testing (`str`).
"""
obsPackage = 'obs_lsst'
"""The obs package associated with ``testDataset`` (`str`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this approach really necessary? I guess this is future-proofing other subpackages/tests using different data?

Copy link
Member Author

@kfindeisen kfindeisen Dec 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty much, yes. It seemed silly (and hard to document) to support multiple datasets but require them to all be obs_lsst. I don't think the subclass code will need to care either way.


Set to `None` if ``testDataset`` loads its own dependencies (not
recommended for test datasets).
"""
datasetKey = 'test'
"""The ap_verify dataset name that would be used on the command line (`str`).
"""
Expand All @@ -54,7 +60,12 @@ def setUpClass(cls):
try:
lsst.utils.getPackageDir(cls.testDataset)
except pexExcept.NotFoundError:
raise unittest.SkipTest(cls.testDataset + ' not set up')
raise unittest.SkipTest(f'{cls.testDataset} not set up')
if cls.obsPackage:
try:
lsst.utils.getPackageDir(cls.obsPackage)
except LookupError:
raise unittest.SkipTest(f'{cls.obsPackage} not set up; needed for {cls.testDataset}')

# Hack the config for testing purposes
# Note that Config.instance is supposed to be immutable, so, depending on initialization order,
Expand Down
1 change: 1 addition & 0 deletions ups/ap_verify.table
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ setupRequired(ctrl_mpexec)

# For testing
setupOptional(ap_verify_testdata)
setupOptional(obs_lsst)

# For default metric configs
setupRequired(ip_diffim)
Expand Down