LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
|
Public Member Functions | |
__init__ (self, str|None index_path=None) | |
ResourcePath | get_apdb_uri (self, str label, str|None format=None) |
Mapping[str, str] | get_entries (self) |
Static Public Attributes | |
ClassVar | index_env_var = "DAX_APDB_INDEX_URI" |
Protected Member Functions | |
Mapping[str, str] | _read_index (self, str|None index_path=None) |
Protected Attributes | |
_index_path | |
_cache | |
Static Protected Attributes | |
Mapping | _cache = None |
Index of well-known Apdb instances. Parameters ---------- index_path : `str`, optional Path to the index configuration file, if not provided then the value of ``DAX_APDB_INDEX_URI`` environment variable is used to locate configuration file. The index is configured from a simple YAML file whose location is determined from ``DAX_APDB_INDEX_URI`` environment variable. The content of the index file is a mapping of the labels to URIs in YAML format, e.g.: .. code-block:: yaml dev: "/path/to/config-file.yaml" "prod/pex_config": "s3://bucket/apdb-prod.py" "prod/yaml": "s3://bucket/apdb-prod.yaml" The labels in the index file consists of the label name and an optional format name separated from label by slash. `get_apdb_uri` method can use its ``format`` argument to return either a format-specific configuration or a label-only configuration if format-specific is not defined.
Definition at line 39 of file apdbIndex.py.
lsst.dax.apdb.apdbIndex.ApdbIndex.__init__ | ( | self, | |
str | None | index_path = None ) |
Definition at line 74 of file apdbIndex.py.
|
protected |
Return contents of the index file. Parameters ---------- index_path : `str`, optional Location of the index file, if not provided then default location is used. Returns ------- entries : `~collections.abc.Mapping` [`str`, `str`] All known entries. Can be empty if no index can be found. Raises ------ RuntimeError Raised if ``index_path`` is not provided and environment variable is not set. TypeError Raised if content of the configuration file is incorrect.
Definition at line 77 of file apdbIndex.py.
ResourcePath lsst.dax.apdb.apdbIndex.ApdbIndex.get_apdb_uri | ( | self, | |
str | label, | ||
str | None | format = None ) |
Return URI for APDB configuration file given its label. Parameters ---------- label : `str` Label of APDB instance. format : `str` Format of the APDB configuration file, arbitrary string. This can be used to support an expected migration from pex_config to YAML configuration for APDB, code that uses pex_config could provide "pex_config" for ``format``. The actual key in the index is either a slash-separated label and format, or, if that is missing, just a label. Returns ------- uri : `~lsst.resources.ResourcePath` URI for the configuration file for APDB instance. Raises ------ FileNotFoundError Raised if an index is defined in the environment but it can not be found. ValueError Raised if the label is not found in the index. RuntimeError Raised if ``index_path`` is not provided and environment variable is not set. TypeError Raised if the format of the index file is incorrect.
Definition at line 123 of file apdbIndex.py.
Mapping[str, str] lsst.dax.apdb.apdbIndex.ApdbIndex.get_entries | ( | self | ) |
Retrieve all entries defined in index. Returns ------- entries : `~collections.abc.Mapping` [`str`, `str`] All known index entries. Raises ------ RuntimeError Raised if ``index_path`` is not provided and environment variable is not set. TypeError Raised if content of the configuration file is incorrect.
Definition at line 171 of file apdbIndex.py.
|
staticprotected |
Definition at line 71 of file apdbIndex.py.
|
protected |
Definition at line 116 of file apdbIndex.py.
|
protected |
Definition at line 75 of file apdbIndex.py.
|
static |
Definition at line 66 of file apdbIndex.py.