Skip to content

DM-56622: fix overzealous check preventing conversion to MultipleCellCoadd - #115

Merged
TallJimbo merged 6 commits into
mainfrom
tickets/DM-56622
Nov 25, 2026
Merged

TallJimbo merged 6 commits into
mainfrom
tickets/DM-56622

Conversation

@TallJimbo

@TallJimbo TallJimbo commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@codecov

codecov Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.55705% with 99 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.13%. Comparing base (e65f4f4) to head (7354cd3).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
tests/test_cell_coadd.py 37.93% 36 Missing ⚠️
python/lsst/images/tests/_checks.py 0.00% 19 Missing ⚠️
python/lsst/images/cells/_aperture_corrections.py 48.38% 16 Missing ⚠️
python/lsst/images/tests/_minify_for_fixtures.py 12.50% 14 Missing ⚠️
tests/test_approximate_from_legacy.py 28.57% 5 Missing ⚠️
tests/test_cell_aperture_corrections.py 54.54% 5 Missing ⚠️
python/lsst/images/_cell_grid.py 0.00% 2 Missing ⚠️
python/lsst/images/cells/_coadd.py 50.00% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@TallJimbo
TallJimbo force-pushed the tickets/DM-56622 branch 2 times, most recently from 0a67483 to 1a5d93f Compare November 24, 2026 15:55

@timj timj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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).

Comment thread python/lsst/images/cells/_provenance.py Outdated
# 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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::

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
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,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

@TallJimbo

Copy link
Copy Markdown
Member Author

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.

TallJimbo and others added 6 commits November 24, 2026 17:56
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>
@TallJimbo
TallJimbo merged commit a528af8 into main Nov 25, 2026
18 of 20 checks passed
@TallJimbo
TallJimbo deleted the tickets/DM-56622 branch November 25, 2026 14: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.

2 participants