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

Tickets/dm 6459 #17

Merged
merged 31 commits into from Jul 20, 2016
Merged

Tickets/dm 6459 #17

merged 31 commits into from Jul 20, 2016

Conversation

n8pease
Copy link
Contributor

@n8pease n8pease commented Jun 10, 2016

No description provided.

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)
Copy link
Contributor

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
Copy link
Member

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.

Nate Pease and others added 19 commits July 18, 2016 12:50
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
@n8pease n8pease merged commit ba289af into master Jul 20, 2016
@ktlim ktlim deleted the tickets/DM-6459 branch August 25, 2018 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants