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-38091: Use InMemoryDatasetHandle #758

Merged
merged 12 commits into from Apr 15, 2023
Merged

DM-38091: Use InMemoryDatasetHandle #758

merged 12 commits into from Apr 15, 2023

Conversation

timj
Copy link
Member

@timj timj commented Feb 21, 2023

Many of the get() implementations here might Just Work using the default ExposureF delegate although the cloning going on makes me worried that the returned item is modified and so it won't work because we don't clone in the default delegate. We might also need to think about a way for an InMemoryDatasetHandle to specify a default dataId constructor and also whether additional kwargs can be stored and then retrieved later on.

Requires lsst/pipe_base#318

Copy link
Contributor

@erykoff erykoff left a comment

Choose a reason for hiding this comment

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

Looks basically good, but I'm a bit worried that we have two different patterns here about how to subclass the InMemoryDatasetHandle, to generate a dataId or not. I'd like to settle on one or the other.

tests/assembleCoaddTestUtils.py Outdated Show resolved Hide resolved
tests/assembleCoaddTestUtils.py Outdated Show resolved Hide resolved
tests/test_makeSurveyPropertyMaps.py Show resolved Hide resolved
@timj timj force-pushed the tickets/DM-38091 branch 3 times, most recently from ca63db3 to 9a800df Compare April 11, 2023 19:39
This mostly involves constructing a dataId
from the kwargs. Some get() methods are
retained because they use clone() to ensure
a deep copy is returned for testing.
This in theory can allow tests to run without requiring a butler
since InMemoryDatasetHandle is designed to be compatible with
a Butler DeferredDatasetHandle.
This removes the use of a butler and significantly
speeds up the testing.
The specialist version did copy the returned data frame
but it seems that the tests don't modify the data anyhow
so there is no need for that to be used.
tests/assembleCoaddTestUtils.py Outdated Show resolved Hide resolved
python/lsst/pipe/tasks/functors.py Show resolved Hide resolved
tests/assembleCoaddTestUtils.py Outdated Show resolved Hide resolved
tests/assembleCoaddTestUtils.py Outdated Show resolved Hide resolved
Previously this triggered an IndexError in assembleMetadata
which is assuming at least one data reference is present.
We still need this method to exist because AssembleCoaddTask
requires that every call to get() returns a brand new
independent clone.
The test doesn't need a real DataCoordinate any more.
@timj timj merged commit bbe75d3 into main Apr 15, 2023
1 check passed
@timj timj deleted the tickets/DM-38091 branch April 15, 2023 04:01
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

3 participants