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-45668: Add --namespace option to ap_verify command line #232

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions doc/lsst.ap.verify/command-line-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Required arguments are :option:`--dataset` and :option:`--output`.
Multiple copies of this argument are allowed.

If this argument is omitted, then all data IDs in the dataset will be processed.

.. option:: --dataset <dataset_package>

**Input dataset package.**
Expand All @@ -87,6 +87,13 @@ Required arguments are :option:`--dataset` and :option:`--output`.

If this argument is omitted, ``ap_verify`` creates an SQLite database inside the directory indicated by :option:`--output`.

.. option:: --namespace

**Namespace to use in the target database**

Takes a namespace string which has is a standard identifier format.
Only relevant for Postgres databases, together with ``--db`` option can be used to run ``ap_verify`` against a shared Postgres database.

.. option:: -h, --help

**Print help.**
Expand All @@ -98,7 +105,7 @@ Required arguments are :option:`--dataset` and :option:`--output`.
**Number of processes to use.**

When ``processes`` is larger than 1 the pipeline may use the Python `multiprocessing` module to parallelize processing of multiple datasets across multiple processors.

.. option:: --output <workspace_dir>

**Output and intermediate product path.**
Expand Down
8 changes: 6 additions & 2 deletions python/lsst/ap/verify/pipeline_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def __init__(self):
self.add_argument("--db", "--db_url", default=None,
help="A location for the AP database, formatted as if for apdb-cli create-sql. "
"Defaults to an SQLite file in the --output directory.")
self.add_argument("--namespace", default=None,
help="Namespace for the AP database.")
self.add_argument("--skip-pipeline", action="store_true",
help="Do not run the AP pipeline itself. This argument is useful "
"for testing metrics on a fixed data set.")
Expand Down Expand Up @@ -215,8 +217,10 @@ def _getApdbArguments(workspace, parsed):
if not parsed.db:
parsed.db = "sqlite:///" + workspace.dbLocation

args = {"db_url": parsed.db,
}
args = {
"db_url": parsed.db,
"namespace": parsed.namespace,
}

return args

Expand Down
Loading