morphology: remove unused imports and dead local, fix import order#3413
Open
brendancol wants to merge 1 commit into
Open
morphology: remove unused imports and dead local, fix import order#3413brendancol wants to merge 1 commit into
brendancol wants to merge 1 commit into
Conversation
Resolves the style-sweep findings for xrspatial/morphology.py (#3400). Cat 3 (F-codes): - F401: drop unused imports xarray as xr (only DataArray is used), has_cuda_and_cupy, and not_implemented_func. - F841: drop the unused local size in _circle_kernel. Cat 4 (isort): normalize import ordering with isort under line_length=100. None of the removed names are re-exported (__init__ exports only the public morph_* functions), so there is no behavior change. flake8 and isort are clean and the 74 morphology tests pass.
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 #3400.
Style sweep cleanup for
xrspatial/morphology.py. Findings came from the project tooling (flake8,isort) under thesetup.cfgconfig (max-line-length=100, line_length=100).Categories addressed:
xarray as xr(onlyDataArrayis used and it is imported on its own line),has_cuda_and_cupy,not_implemented_func.sizein_circle_kernel(computed, never read).No behavior change. None of the removed names are re-exported.
xrspatial/__init__.pyre-exports only the publicmorph_*functions, and the module is not star-imported anywhere, so dropping these names is safe.Verification:
flake8 xrspatial/morphology.pycleanisort --check-only xrspatial/morphology.pycleantest_morphology.py,test_morphology_derived.py)Cat 1, Cat 2, and Cat 5 were clean: no E/W codes after the fix, and grep found no bare except, mutable default args,
== None/True/False, or shadowed builtins.