LSST Applications
21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
|
Public Member Functions | |
def | __init__ (self) |
def | getRepositoryCfg (self, uri) |
Static Public Member Functions | |
def | registerStorageClass (scheme, cls) |
def | putRepositoryCfg (cfg, uri) |
def | getMapperClass (uri) |
def | makeFromURI (uri, create=True) |
def | isPosix (uri) |
def | relativePath (fromUri, toUri) |
def | absolutePath (fromUri, toUri) |
def | search (uri, path) |
def | storageExists (uri) |
Public Attributes | |
repositoryCfgs | |
Static Public Attributes | |
dictionary | storages = {} |
Base class for storages
Definition at line 29 of file storage.py.
def lsst.daf.persistence.storage.Storage.__init__ | ( | self | ) |
Definition at line 34 of file storage.py.
|
static |
Get an absolute path for the path from fromUri to toUri Parameters ---------- fromUri : the starting location Description toUri : the location relative to fromUri Description Returns ------- string URI that is absolutepath fromUri + toUri, if one exists. If toUri is absolute or if fromUri is not related to toUri (e.g. are of different storage types) then toUri will be returned.
Definition at line 220 of file storage.py.
|
static |
Get a mapper class cfg value from location described by uri. Note that in legacy repositories the mapper may be specified by a file called _mapper at the uri location, and in newer repositories the mapper would be specified by a RepositoryCfg stored at the uri location. .. warning:: Storage is 'wet paint' and very likely to change during factorization of Butler back end and storage formats (DM-6225). Use of it in production code other than via the 'old butler' API is strongly discouraged.
Definition at line 103 of file storage.py.
def lsst.daf.persistence.storage.Storage.getRepositoryCfg | ( | self, | |
uri | |||
) |
Get a RepositoryCfg from a location specified by uri. If a cfg is found then it is cached by the uri, so that multiple lookups are not performed on storages that might be remote. RepositoryCfgs are not supposed to change once they are created so this should not lead to stale data.
Definition at line 70 of file storage.py.
|
static |
Test if a URI is for a local filesystem storage. This is mostly for backward compatibility; Butler V1 repositories were only ever on the local filesystem. They may exist but not have a RepositoryCfg class. This enables conditional checking for a V1 Repository. This function treats 'file' and '' (no scheme) as posix storages, see the class docstring for more details. Parameters ---------- uri : string URI to the root of a Repository. Returns ------- Bool True if the URI is associated with a posix storage, else false.
Definition at line 168 of file storage.py.
|
static |
Instantiate a StorageInterface sublcass from a URI. .. warning:: Storage is 'wet paint' and very likely to change during factorization of Butler back end and storage formats (DM-6225). Use of it in production code other than via the 'old butler' API is strongly discouraged. Parameters ---------- uri : string The uri to the root location of a repository. create : bool, optional If True The StorageInterface subclass should create a new repository at the root location. If False then a new repository will not be created. Returns ------- A Storage subclass instance, or if create is False and a repository does not exist at the root location then returns None. Raises ------ RuntimeError When a StorageInterface subclass does not exist for the scheme indicated by the uri.
Definition at line 126 of file storage.py.
|
static |
Write a RepositoryCfg object to a location described by uri
Definition at line 92 of file storage.py.
|
static |
Register derived classes for lookup by URI scheme. A scheme is a name that describes the form a resource at the beginning of a URI e.g. 'http' indicates HTML and related code, such as is found in http://www.lsst.org The only currently supported schemes are: * 'file' where the portion of the URI after the // indicates an absolute locaiton on disk. for example: file:/my_repository_folder/ * '' (no scheme) where the entire string is a relative path on the local system for example "my_repository_folder" will indicate a folder in the current working directory with the same name. See documentation for the urlparse python library for more information. .. warning:: Storage is 'wet paint' and very likely to change during factorization of Butler back end and storage formats (DM-6225). Use of it in production code other than via the 'old butler' API is strongly discouraged. Parameters ---------- scheme : str Name of the `scheme` the class is being registered for, which appears at the beginning of a URI. cls : class object A class object that should be used for a given scheme.
Definition at line 38 of file storage.py.
|
static |
Get a relative path from a location to a location, if a relative path for these 2 locations exists. Parameters ---------- fromPath : string A URI that describes a location at which to start. toPath : string A URI that describes a target location. Returns ------- string A relative path that describes the path from fromUri to toUri, provided one exists. If a relative path between the two URIs does not exist then the entire toUri path is returned.
Definition at line 194 of file storage.py.
|
static |
Look for the given path in a storage root at URI; return None if it can't be found. If the path contains an HDU indicator (a number in brackets before the dot, e.g. 'foo.fits[1]', this will be stripped when searching and so will match filenames without the HDU indicator, e.g. 'foo.fits'. The path returned WILL contain the indicator though, e.g. ['foo.fits[1]']. Parameters ---------- root : string URI to the the root location to search path : string A filename (and optionally prefix path) to search for within root. Returns ------- string or None The location that was found, or None if no location was found.
Definition at line 246 of file storage.py.
|
static |
Ask if a storage at the location described by uri exists Parameters ---------- root : string URI to the the root location of the storage Returns ------- bool True if the storage exists, false if not
Definition at line 274 of file storage.py.
lsst.daf.persistence.storage.Storage.repositoryCfgs |
Definition at line 35 of file storage.py.
|
static |
Definition at line 32 of file storage.py.