-
Notifications
You must be signed in to change notification settings - Fork 1
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-47535: Actually save calibrated catalog in ReprocessVisitImage. #81
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
0b1a99f
Actually save calibrated catalog in ReprocessVisitImage.
TallJimbo 891dead
Add flux columns to reprocessVisitImage schema init-output.
TallJimbo c2f991a
Fix copy/paste bug in test case name.
TallJimbo 4e159e9
Add more testing for ReprocessVisitImageTask.
TallJimbo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Oh, shoot! Thanks for catching this. I see I didn't have a test that the
_flux
columns were in the output intest_reprocess_visit_image.py
. Can you please add that? Either a test of existence, and/or a check that the brightestPsfFlux_flux
value matchesself.photo_calib*self.fluxes[-1]
(which is the brightest in the input catalog).Also, while you're at it, please fix
_apply_photo_calib()
to not re-usesources_footprints
, since that might be how I managed to confuse myself.photo_calib.calibrateCatalog
not being in-place is different from many of our other catalog operations, but there's a good reason it can't be in-place. But I still screwed it up.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.
In thinking about adding at test to
drp_tasks
(note that this is now already tested inci_hsc
andci_imsim
) I thought, "oh, I'll test that the schema init-output is consistent with the output catalog." And then I realized that the schema is not going to be consistent, because it doesn't have the flux fields, and we don't have a good way to make it consistent.At this point I'm inclined to just remove the
sources_schema
connection, as I don't anticipate anything consuming it, but I'd be interested in your thoughts on that.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.
Oh, nevermind, I bet we do have an easy way to fix it: since the init-output is a catalog with no rows, I think we can just call
calibrateCatalog
with a dummyPhotoCalib
in__init__
.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.
Ok, given that the tests in
drp_pipe
are all mocks-based, adding a test there is considerably harder than upgrading the ones inci_hsc
andci_hsc
, so that's what I've done - those now check that the schema and the output catalog are consistent, and the existing test onLocalPhotoCalib
checks that the flux columns are present. I'm starting a new Jenkins run now to make sure that all works.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.
Ah, good catch: I'd forgotten about that schema; we probably want a check in this package's tests that the
sources_schema
produced by__init__
matches the schema of the outputsources
catalog, since it's not something that needsci_*
to check.I added that schema connection because when I was working on
reprocessVisitImage
, I had to add an output schema tofinalizeCharacterization
to take as an input here, even though Eli had had a similar thought of "this is the final point in the pipeline, nobody's ever going to need the schema".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.
I don't want us to push tests into
ci_*
that could really be done in this package instead. Those packages take far too long to run, and I think we already have too much testing dependency on them.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.
I had the same thought, but the tests in
drp_tasks
don't actually callrun
; that's completely mocked out. So there's no source catalog here to check.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.
What? Yes they do! You can put that test at the end of this one!
https://github.com/lsst/drp_tasks/blob/main/tests/test_reprocess_visit_image.py#L186
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.
Ah, I saw that the test case was called
CalibrateImageTasksTests
and didn't look deeper, but now that I have I think that name is a copy-paste bug. Anyhow, yes, I'll put the new test there (and rename the test case).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.
Ok, tests are in place in drp_tasks.