-
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-46942: Raise UpstreamFailureNoWorkFound in ReprocessVisitImageTask when detector is missing a necessary calibration #77
Conversation
d0fcabc
to
f7dfadf
Compare
if detector_summary.apCorrMap is None: | ||
msg += "\n > the aperture correction model map for the detector is None" | ||
if detector_summary.photoCalib is None: | ||
msg += "\n > the photometric calibration model for the detector is None" |
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.
It's not a big deal here, but when composing multi-line strings programmatically, it's usually better to append to a list
of lines and use "\n".join(lines)
" to stitch them together.
The main advantage is memory allocation efficiency, which only comes into play when there is a very large number of lines, but I think that makes it good practice for consistency everywhere.
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.
Always love a good best-practice coding tip from you 😄
msg += "\n > the aperture correction model map for the detector is None" | ||
if detector_summary.photoCalib is None: | ||
msg += "\n > the photometric calibration model for the detector is None" | ||
if len(msg) > 0: |
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.
if msg:
is generally better (or if lines:
, per the thread above).
tests/test_reprocess_visit_image.py
Outdated
self.butler.put(lsst.afw.table.SourceCatalog().asAstropy(), "finalized_src_table", self.visit_only_id) | ||
self.butler.put(make_visit_summary(detector=detector), "finalVisitSummary", self.visit_only_id) | ||
# Make a simple single gaussian psf so that psf is not None in | ||
# finalVisitSummary table whcih would result in |
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.
# finalVisitSummary table whcih would result in | |
# finalVisitSummary table which would result in |
If any of the relevant single frame calibrations are missing from the final visit summary table, a "calibrated" image cannot be created, so catch these and raise UpstreamFailureNoWorkFound so that we know there was a failure upstream, but that downstream tasks know to skip this dataId.
f7dfadf
to
73cffd5
Compare
No description provided.