Repository navigation
fix: correct rectangular grid cache cell bounds - #8
Draft
afonsobspinto wants to merge 1 commit into
Draft
afonsobspinto wants to merge 1 commit into
afonsobspinto wants to merge 1 commit into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose
Draft for internal review before opening against upstream
catmaid/CATMAID:dev. The rectangular-cell fix is already included infeature/new-ingestion(PR #7). This PR isolates it for review; it does not introduce a separate ingestion workflow.What changed and why
update_grid_cell()calculated the lower Y boundary using the cell's width, although its upper Y boundary used the height. This produces the wrong query extent whenever grid cells are rectangular.bottom = h_i * cell_height + cell_widthbottom = (h_i + 1) * cell_heightThe X and Z bounds and square-cell behavior stay the same. The correction applies to normal cache workers and other callers of
update_grid_cell(), including the final ingestion cache rebuild.Before and after examples
For Y index
h_i=2, in the same coordinate units as the grid:The expected range is always
[h_i * cell_height, (h_i + 1) * cell_height].Validation
Adds a regression test that checks the bounding-box parameters passed to the real
update_grid_cell()query boundary for zero, positive and negative cell indices. All three subcases fail with the original formula and pass with the correction.Validated on the internal
metacellbase with Django 4.2.30, and previously on upstreamdevwith Django 5.2.17.python manage.py test catmaid.tests.test_grid_cacheNo database migrations. This internal branch contains one fix commit directly on
metacell; cherry-pick it onto current upstreamdevafter internal review.