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
Tickets/dm 6459 #17
Tickets/dm 6459 #17
Conversation
this adds a RepoData class to manage repo info in butler 2 lists of repositories are now created: butler.outputs: used when writing butler.inputs used when reading the same RepoData may appear in both lists (in the case of read-write repositories). RepoDatas in the input list are in search-order. removes some vestigial code, where repos managed their parents and peers. certainly lots of other things are broken. this change will be trickling down through several commits.
general: * remove access class usage * fixes unit tests butler.py: * move RepoData out of ButlerClass (it remains in butlery.py) * implement butler use of input/output API butlerFactory.py * add creation of PosixStorage cfg when it’s possible (I think this class is deprecated so I wasn’t worried about other storages) posixStorage.py * create a base class Storage and create a new file for it * move StorageCfg into storage.py repository.py * removes old parent & peer repo code
fixes repositoryCfg unit test. dict appearantly has some internal special sauce that allows it to handle set values. Creating a custom dict class by subclassing UserDict requires special handling in the __cmp__ operator to take advantage of this.
if cfg['mode'] == 'r': | ||
raise RuntimeError('Output repositories must not be read only.') | ||
# All inputs become parents of each output, so add them to each output cfg: | ||
cfg['parentCfgs'].extend(inputs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any problem if the output repo already has the input repo as a parent?
|
||
def testGet(self): | ||
raw_image = self.butler.get(self.datasetType, {'visit':'2', 'filter':'g'}) | ||
raw_image = self.butler.get('raw', {'visit':'2', 'filter':'g'}) | ||
# in this case the width is known to be 1026: | ||
self.assertEqual(raw_image[1].header["NAXIS1"], 1026) # raw_image is an lsst.afw.ExposureU |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not this changeset, but this comment is definitely wrong. It looks like it may be a PyFITS/astropy.io.fits object.
many changes here, redefine butler input/output API to take RepositoryArgs. RepositoryCfg is now the persistable defintion of a repoisotry's parameters. RepositoryArgs is how you tell Butler how to set up a repository and the context that butler needs to use it as desired.
…ssue parent cfg fix prevents parents from being listed in a RepositoryCfg multiple times when loading a repo as a butler output multiple times
Storage subclasses now register themselves with Storage as subclases for a particular scheme. We decided that Storage should remain a base class for particular subclasses for the purpose of documenting the interface.
caching code was missing for the all() case
I'm not sure this is ideal. Needs discussion.
No description provided.