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

DM-20205 Add ability to defer loading datasets #181

Merged
merged 1 commit into from Aug 30, 2019
Merged

Conversation

natelust
Copy link
Contributor

Add the ability for the butler to return a handle to a dataset
such that actual loading of the dataset can occur at a later time.

Copy link
Contributor

@andy-slac andy-slac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK but please check parameter to self._get call.


@dataclasses.dataclass(frozen=True)
class DeferredDatasetHandle:
"""Class to support deferred loading of a dataset from a butler
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sentences should end with dot.

typically used to efficiently read only a subset of the dataset.
kwds : `dict`
Additional keyword arguments used to augment or construct a
`DataId`. See `DataId` parameters.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

``dataId`` parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No in this case I do mean a DataId object itself

else:
mergedParameters = {}

return self._get(parameters)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to pass mergedParameters here?

parameters : `dict` or None
parameters passed to the butler get method. Defaults to None.
If not None, this dict will be merged with the parameters dict
used to construct the `DeferredDatasetHandle` class
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sentences should start with capital letter and end with dot.

def getDeferred(self, datasetRefOrType: typing.Union[DatasetRef, DatasetType, str],
dataId: typing.Union[dict, DataId] = None, parameters: typing.Union[dict, None] = None,
**kwds) -> dDH.DeferredDatasetHandle:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extraneous empty line

@natelust natelust force-pushed the tickets/DM-20205 branch 2 times, most recently from 45fb698 to 16cb489 Compare August 27, 2019 13:32
Add the ability for the butler to return a handle to a dataset
such that actual loading of the dataset can occur at a later time.
@TallJimbo TallJimbo merged commit 2728517 into master Aug 30, 2019
@TallJimbo TallJimbo deleted the tickets/DM-20205 branch August 30, 2019 12:11
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