Fix flake8 E201 in edge_detection kernel literals (#3675)#3679
Open
brendancol wants to merge 1 commit into
Open
Fix flake8 E201 in edge_detection kernel literals (#3675)#3679brendancol wants to merge 1 commit into
brendancol wants to merge 1 commit into
Conversation
brendancol
commented
Jul 18, 2026
brendancol
left a comment
Contributor
Author
There was a problem hiding this comment.
PR Review: Fix flake8 E201 in edge_detection kernel literals (#3675)
Blockers (must fix before merge)
None.
Suggestions (should fix, not blocking)
None.
Nits (optional improvements)
- xrspatial/edge_detection.py:12-14 and 21-23: dropping the leading space loses the first-column alignment that lined the 0/1 rows up under the -1 rows. A per-line
# noqa: E201would have kept it, but the new form matchesLAPLACIAN_KERNELa few lines down, so the file is at least internally consistent now. Fine as is.
What looks good
- The kernel edits are whitespace-only.
SOBEL_YandPREWITT_Ystill equal their previous values, and none of the five public functions changed. - The test-file import reflow is what the configured isort (line_length=100) produces, and the E302 fix takes the file to zero flake8 findings.
- No runtime code paths are touched. All four backends route through
convolve_2d, which this PR leaves alone. - State CSV row for edge_detection is one physical line and follows the existing schema.
Checklist
- Algorithm matches reference (kernels numerically unchanged)
- All implemented backends produce consistent results (no runtime change)
- NaN handling is correct (untouched)
- Edge cases are covered by tests (existing 87 tests pass)
- Dask chunk boundaries handled correctly (untouched)
- No premature materialization or unnecessary copies
- Benchmark exists or is not needed (style-only change)
- README feature matrix updated (not applicable, no new functions)
- Docstrings present and accurate (unchanged)
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.
Closes #3675
Style cleanup from a /sweep-style pass over
xrspatial/edge_detection.py. Categories addressed: Cat 1 (E201, E302) and Cat 4 (isort, test file only).[in theSOBEL_YandPREWITT_Ykernel literals (the 4 E201 lines flake8 reports on this file). Matches theLAPLACIAN_KERNELstyle already in the file; kernels are numerically identical.test_edge_detection.py: add the missing second blank line before the first fixture (E302) and apply isort's import-block reflow for the configuredline_length=100.No behavior change. The module only wraps
convolve_2d, so backend coverage is untouched (numpy / cupy / dask+numpy / dask+cupy all go through convolution).Test plan:
flake8 xrspatial/edge_detection.py xrspatial/tests/test_edge_detection.pycleanisort --check-onlyclean on both filestest_edge_detection.pypass locally (CUDA host, GPU tests run)