Skip to content

Drop unused math import and fix isort drift in interpolate (#3286)#3287

Merged
brendancol merged 1 commit into
mainfrom
deep-sweep-style-interpolate-2026-06-12
Jun 12, 2026
Merged

Drop unused math import and fix isort drift in interpolate (#3286)#3287
brendancol merged 1 commit into
mainfrom
deep-sweep-style-interpolate-2026-06-12

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

Closes #3286

Style cleanup from the /sweep-style audit of xrspatial/interpolate:

  • Cat 3 (F401): removed the unused import math from _idw.py. The IDW kernels only do arithmetic; _spline.py keeps its math import for math.log in the TPS kernels. math is not re-exported (interpolate/__init__.py exports only idw, kriging, spline), so nothing user-facing changes.
  • Cat 4 (isort): reflowed the from xrspatial.utils import (...) block in _idw.py and _spline.py from one-name-per-line to two lines under the configured line_length=100. _kriging.py got the same fix in Style: fix flake8 E128 and isort drift in interpolate/_kriging.py #2916; this makes the subpackage consistent.

No behavior change. Imports only, no executable code touched. Style fixes apply uniformly across all four backends (numpy / cupy / dask+numpy / dask+cupy).

Test plan:

  • flake8 xrspatial/interpolate/ reports nothing
  • isort --check-only xrspatial/interpolate/ passes
  • pytest xrspatial/tests/test_interpolation.py — 66 passed (CUDA available)

Also updates .claude/sweep-style-state.csv with the interpolate row.

@github-actions github-actions Bot added the performance PR touches performance-sensitive code label Jun 12, 2026

@brendancol brendancol left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

PR Review: Drop unused math import and fix isort drift in interpolate (#3286)

Blockers

None.

Suggestions

None.

Nits

None.

What looks good

  • The F401 fix is safe. math has no other references in _idw.py (the IDW kernels use plain arithmetic and **), and interpolate/__init__.py re-exports only idw, kriging, and spline, so the public surface is unchanged.
  • _spline.py keeps its math import, which is still used (math.log in the TPS kernels at lines 120 and 156).
  • The reflowed from xrspatial.utils import (...) blocks match what #2916 did to _kriging.py, so the subpackage import style is now consistent. flake8 and isort --check-only both pass on xrspatial/interpolate/.
  • The state CSV row stays on one physical line, is keyed interpolate, and leaves the older interpolate-kriging row alone.

Checklist

  • Algorithm / NaN / dask / GPU checks: not applicable, no executable code changed
  • Backend coverage: unchanged; 66 interpolation tests pass (CUDA available)
  • Benchmarks, README matrix, docstrings: not applicable for an imports-only change

@brendancol brendancol merged commit a3b5114 into main Jun 12, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Style: unused import and isort drift in xrspatial/interpolate

1 participant