Repository navigation
DM-56622: fix overzealous check preventing conversion to MultipleCellCoadd - #115
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #115 +/- ##
==========================================
- Coverage 66.31% 66.13% -0.19%
==========================================
Files 159 159
Lines 24248 24370 +122
==========================================
+ Hits 16081 16118 +37
- Misses 8167 8252 +85 ☔ View full report in Codecov by Harness. |
0a67483 to
1a5d93f
Compare
timj
left a comment
There was a problem hiding this comment.
Looks good. Minor comments and Claude had found four things it thinks need fixing. Ended up with a new json test fixture but I guess the other approach is to edit the original cell_coadd fixture without regenerating it (regenerating changes the x/y I think).
| # the same observation appearing in multiple cells. | ||
| inputs = astropy.table.unique( | ||
| astropy.table.join(contributions["instrument", "visit", "detector"], self._inputs), | ||
| keys=["instrument", "visit", "detector"], # pass keys explicitly to avoid duplicates |
There was a problem hiding this comment.
we say we are avoiding duplicates also in the comment above.
| Run interactively (CellCoadd works with just this package installed; | ||
| VisitImage needs a full Rubin environment so the real PSF can be read):: | ||
| Run interactively; the input must be a native ``lsst.images`` archive, so | ||
| legacy files under ``$TESTDATA_IMAGES_DIR`` are must be converted first:: |
There was a problem hiding this comment.
| legacy files under ``$TESTDATA_IMAGES_DIR`` are must be converted first:: | |
| legacy files under ``$TESTDATA_IMAGES_DIR`` must be converted first:: |
| @@ -1387,10 +1387,6 @@ | |||
| "data": { | |||
| "data": [ | |||
| 2025052000177, | |||
There was a problem hiding this comment.
Hand editing "as shipped" files seems to go against the notion of "as shipped" but in this case it's fixing example data values and not changing structure so is fine.
There was a problem hiding this comment.
My reasoning was that the duplicates were due to a bug firing inside the minify code, not the converter, so the previous state didn't actually represent what was shipped any better.
d3bee31 to
a8d635a
Compare
|
I squashed the fix for the unit test that didn't actually demonstrate the bug into the commit that fixed that bug. I dropped the commit that updated the legacy-comparison test utility code. It's just a lot of code that I don't think we need, because the cost is just that various pathological aperture corrections can't be used in unit tests. And the fact that that code ran in verify-rewrite against the production DP2 conversion gives me confidence that those pathological cases are just hypothetical. All other fixes accepted. |
This also removes duplicates in some committed test JSON test data from the same bug. AI-authored with rewritten docs/comments.
The old logic assumed that .bounds.bbox had to be larger than .bbox because the .bounds.bbox "snaps" outward onto the cell grid. But if there's a whole row or column of missing cells on the outside, .bounds.bbox will shrink, which would cause a spurious failure. Tests are AI-assisted.
When there are no usable cells for a coadd aperture correction, we map that name to None instead of: - dropping it from the map (which would make it impossible to round-trip the name); - creating a CellField with empty bounds (because we're trying to keep the bounds classes simple by not forcing them to be able to represent emptiness). AI-assisted.
When an *_instFlux field converts to None, its *_instFluxErr partner was evaluated over the full bounds with zero treated as a usable value, so a legacy field that only returned its default produced a CellField of zeros instead of None. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The minify helper now keeps an unusable (None) aperture correction and no longer duplicates provenance inputs, but the cell_coadd fixture had not been regenerated, so neither path was covered. The as_shipped fixture preserves the bytes of a shipped file (including the array spelling of XY pairs) and must not be regenerated, so the new output is added as a canonical dp2 variant and the tests that use the minified coadd read that instead. Provenance expectations change to the six distinct inputs the fixture now carries, and the helper that drops the last column of cells passes None aperture corrections through. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a8d635a to
7354cd3
Compare
Checklist
doc/changes