Skip to content

Commit

Permalink
Add "database config" field to Workspace.
Browse files Browse the repository at this point in the history
This field specifies where to store the config created by ap_verify.
  • Loading branch information
kfindeisen committed Apr 25, 2024
1 parent 3b984d4 commit 19de37e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
13 changes: 13 additions & 0 deletions python/lsst/ap/verify/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ def dbLocation(self):
Shall be a pathname to a database suitable for the backend of `Apdb`.
"""

@property
@abc.abstractmethod
def dbConfigLocation(self):
"""The absolute location of the config file for the source association
database to be created or updated by the pipeline(`str`, read-only).
The location is assumed to be a Python (`lsst.pex.config.Config`) file.
"""

@property
@abc.abstractmethod
def alertLocation(self):
Expand Down Expand Up @@ -189,6 +198,10 @@ def pipelineDir(self):
def dbLocation(self):
return os.path.join(self._location, 'association.db')

@property
def dbConfigLocation(self):
return os.path.join(self._location, 'apdb.py')

@property
def alertLocation(self):
return os.path.join(self._location, 'alerts')
Expand Down
9 changes: 9 additions & 0 deletions tests/test_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@ def testDatabase(self):
# Workspace spec allows these to be URIs or paths, whatever the Butler accepts
self._assertNotInDir(self._testbed.dbLocation, url2pathname(self._testbed.repo))

def testDbConfig(self):
"""Verify that a WorkspaceGen3 requests a database config in the target
directory, but not in any repository.
"""
root = self._testWorkspace
self._assertInDir(self._testbed.dbConfigLocation, root)
# Workspace spec allows these to be URIs or paths, whatever the Butler accepts
self._assertNotInDir(self._testbed.dbConfigLocation, url2pathname(self._testbed.repo))

def testAlerts(self):
"""Verify that a WorkspaceGen3 requests an alert dump in the target
directory, but not in any repository.
Expand Down

0 comments on commit 19de37e

Please sign in to comment.