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-24259: Create “stub“ Gen2 HSC dataset for CI testing #82

Merged
merged 2 commits into from
Apr 27, 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
1 change: 1 addition & 0 deletions config/dataset_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
datasets:
HiTS2015: ap_verify_hits2015
CI-HiTS2015: ap_verify_ci_hits2015
CI-CosmosPDR2: ap_verify_ci_cosmos_pdr2
...
26 changes: 16 additions & 10 deletions python/lsst/ap/verify/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ class Workspace:
"""

def __init__(self, location):
self._location = location
# Properties must be `str` for backwards compatibility
self._location = str(pathlib.Path(location).resolve())

mode = stat.S_IRWXU | stat.S_IRGRP | stat.S_IROTH # a+r, u+rwx
kwargs = {"parents": True, "exist_ok": True, "mode": mode}
Expand All @@ -66,45 +67,50 @@ def __init__(self, location):

@property
def workDir(self):
"""The location of the workspace as a whole (`str`, read-only).
"""The absolute location of the workspace as a whole
(`str`, read-only).
"""
return self._location

@property
def configDir(self):
"""The location of a directory containing custom Task config files for
use with the data (`str`, read-only).
"""The absolute location of a directory containing custom Task config
files for use with the data (`str`, read-only).
"""
return os.path.join(self._location, 'config')

@property
def dataRepo(self):
"""The URI to a Butler repo for science data (`str`, read-only).
"""The absolute path/URI to a Butler repo for science data
(`str`, read-only).
"""
return os.path.join(self._location, 'ingested')

@property
def calibRepo(self):
"""The URI to a Butler repo for calibration data (`str`, read-only).
"""The absolute path/URI to a Butler repo for calibration data
(`str`, read-only).
"""
return os.path.join(self._location, 'calibingested')

@property
def templateRepo(self):
"""The URI to a Butler repo for precomputed templates (`str`, read-only).
"""The absolute path/URI to a Butler repo for precomputed templates
(`str`, read-only).
"""
return self.dataRepo

@property
def outputRepo(self):
"""The URI to a Butler repo for AP pipeline products (`str`, read-only).
"""The absolute path/URI to a Butler repo for AP pipeline products
(`str`, read-only).
"""
return os.path.join(self._location, 'output')

@property
def dbLocation(self):
"""The default location of the source association database to be
created or updated by the pipeline (`str`, read-only).
"""The default absolute location of the source association database to
be created or updated by the pipeline (`str`, read-only).

Shall be a filename to a database file suitable
for the sqlite backend of `Apdb`.
Expand Down
3 changes: 2 additions & 1 deletion tests/test_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ def testDirectories(self):

The exact repository locations are not tested, as they are likely to change.
"""
root = self._testWorkspace
# Workspace should report all paths as absolute
root = os.path.abspath(os.path.realpath(self._testWorkspace))
self.assertEqual(self._testbed.workDir, root)
self._assertInDir(self._testbed.configDir, root)
for repo in WorkspaceTestSuite._allRepos(self._testbed):
Expand Down