RegistryConfig¶
- class lsst.daf.butler.registry.RegistryConfig(other: Config | str | ParseResult | ResourcePath | Path | Mapping[str, Any] | None = None, validate: bool = True, mergeDefaults: bool = True, searchPaths: Sequence[str | ParseResult | ResourcePath | Path] | None = None)¶
- Bases: - ConfigSubset- Configuration specific to a butler Registry. - Attributes Summary - Component to use from supplied config. - Return the connection string to the underlying database ( - sqlalchemy.engine.url.URL).- Name of the file containing defaults for this config class. - Keys that are required to be specified in the configuration. - Methods Summary - Return the - Databaseclass targeted by configuration values.- Parse the - dbkey of the config and returns the database dialect.- makeDefaultDatabaseUri(root)- Return a default 'db' URI for the registry configured here that is appropriate for a new empty repository with the given root. - replaceRoot(root)- Replace any occurrences of - BUTLER_ROOT_TAGin the connection with the given root directory.- Attributes Documentation - component: ClassVar[str | None] = 'registry'¶
- Component to use from supplied config. Can be None. If specified the key is not required. Can be a full dot-separated path to a component. 
 - connectionString¶
- Return the connection string to the underlying database ( - sqlalchemy.engine.url.URL).
 - defaultConfigFile: ClassVar[str | None] = 'registry.yaml'¶
- Name of the file containing defaults for this config class. 
 - requiredKeys: ClassVar[Sequence[str]] = ('db',)¶
- Keys that are required to be specified in the configuration. 
 - Methods Documentation - getDatabaseClass() type[lsst.daf.butler.registry.interfaces._database.Database]¶
- Return the - Databaseclass targeted by configuration values.- The appropriate class is determined by parsing the - dbkey to extract the dialect, and then looking that up under the- engineskey of the registry config.
 - getDialect() str¶
- Parse the - dbkey of the config and returns the database dialect.- Returns:
- dialectstr
- Dialect found in the connection string. 
 
- dialect
 
 - makeDefaultDatabaseUri(root: str) str | None¶
- Return a default ‘db’ URI for the registry configured here that is appropriate for a new empty repository with the given root. - Parameters:
- rootstr
- Filesystem path to the root of the data repository. 
 
- root
- Returns:
- uristr
- URI usable as the ‘db’ string in a - RegistryConfig.
 
- uri
 
 - replaceRoot(root: ResourcePathExpression | None) None¶
- Replace any occurrences of - BUTLER_ROOT_TAGin the connection with the given root directory.- Parameters:
- rootlsst.resources.ResourcePathExpression, orNone
- String to substitute for - BUTLER_ROOT_TAG. Passing- Nonehere is allowed only as a convenient way to raise an exception (- ValueError).
 
- root
- Raises:
- ValueError
- Raised if - rootis not set but a value is required.