Reason or Problem
The geotiff subpackage has no flake8 or isort check in CI, so style drift piles up unnoticed. Running the project's own configured tooling (setup.cfg: flake8 max-line-length=100, isort line_length=100) turns up a small batch of real issues. The 33 source files are clean. Everything flagged lives in the test suite, apart from two import blocks in source files.
Proposal
Apply the project's configured flake8 + isort tooling to the geotiff subpackage and fix what it reports. Style-only cleanup, no behavioural change.
Findings (tool-confirmed):
pyflakes F-codes (dead code that can mask refactor leftovers):
tests/unit/test_geotags.py:4: F401 struct imported but unused at module level
tests/unit/test_geotags.py:256, :408: F811 redefinition of unused struct; a local import struct inside two functions shadows the dead top-level import
tests/unit/test_metadata.py:1446: F841 local ascii_buf assigned but never used
Line length:
tests/unit/test_metadata.py:31: E501 (101 > 100), part of a multi-line import block that isort reflows
Import ordering (isort):
- Source files:
__init__.py and _writers/eager.py
- ~40 test files under
tests/
Trailing blank line:
tests/unit/test_geotags.py:833: W391
Value
Removes dead test imports and a dead local, and brings the subpackage in line with the project's own isort/flake8 config so future drift is easier to spot.
Drawbacks
The isort pass reorders imports across roughly 40 test files, which is churn. The diff is mechanical and reviewable file by file.
Additional Notes or Context
Scope guardrails: no black/autopep8/ruff-format, no config widening. Fixes limited to what flake8 + isort report. Verify with flake8 xrspatial/geotiff/ (expect 0) and isort --check-only xrspatial/geotiff/ (expect clean).
Found by /sweep-style.
Reason or Problem
The geotiff subpackage has no flake8 or isort check in CI, so style drift piles up unnoticed. Running the project's own configured tooling (setup.cfg: flake8 max-line-length=100, isort line_length=100) turns up a small batch of real issues. The 33 source files are clean. Everything flagged lives in the test suite, apart from two import blocks in source files.
Proposal
Apply the project's configured flake8 + isort tooling to the geotiff subpackage and fix what it reports. Style-only cleanup, no behavioural change.
Findings (tool-confirmed):
pyflakes F-codes (dead code that can mask refactor leftovers):
tests/unit/test_geotags.py:4: F401structimported but unused at module leveltests/unit/test_geotags.py:256,:408: F811 redefinition of unusedstruct; a localimport structinside two functions shadows the dead top-level importtests/unit/test_metadata.py:1446: F841 localascii_bufassigned but never usedLine length:
tests/unit/test_metadata.py:31: E501 (101 > 100), part of a multi-line import block that isort reflowsImport ordering (isort):
__init__.pyand_writers/eager.pytests/Trailing blank line:
tests/unit/test_geotags.py:833: W391Value
Removes dead test imports and a dead local, and brings the subpackage in line with the project's own isort/flake8 config so future drift is easier to spot.
Drawbacks
The isort pass reorders imports across roughly 40 test files, which is churn. The diff is mechanical and reviewable file by file.
Additional Notes or Context
Scope guardrails: no black/autopep8/ruff-format, no config widening. Fixes limited to what flake8 + isort report. Verify with
flake8 xrspatial/geotiff/(expect 0) andisort --check-only xrspatial/geotiff/(expect clean).Found by
/sweep-style.