Skip to content

Style: drop dead code + fix import ordering in fire.py#3397

Merged
brendancol merged 2 commits into
mainfrom
deep-sweep-style-fire-2026-06-19
Jun 19, 2026
Merged

Style: drop dead code + fix import ordering in fire.py#3397
brendancol merged 2 commits into
mainfrom
deep-sweep-style-fire-2026-06-19

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

Closes #3395.

Style sweep on xrspatial/fire.py. The project's flake8 and isort configs (setup.cfg) flag dead code that nothing in CI checks for.

What changed:

  • Drop unused log from the math import (flake8 F401)
  • Drop unused S_T local in _rothermel_fuel_constants (flake8 F841); S_e and rho_p next to it are still used, and the ANDERSON_13 table column + its comment are untouched
  • isort reorders the xrspatial.utils import block to the grid layout (Cat 4)

Categories addressed: Cat 3 (F401, F841), Cat 4 (isort). No Cat 1/2/5 findings.

No behavioural change. Removing the log import and S_T local touches no runtime logic, so all four backends (numpy, cupy, dask+numpy, dask+cupy) are unaffected.

Test plan:

  • flake8 xrspatial/fire.py is clean
  • isort --check-only xrspatial/fire.py is clean
  • pytest xrspatial/tests/test_fire.py: 54 passed

- Remove unused 'log' from math import (F401)
- Remove unused S_T local in _rothermel_fuel_constants (F841)
- isort reorder of xrspatial.utils import block (Cat 4)

No behavioural change. flake8 + isort now clean on fire.py; 54 fire
tests still pass. Update sweep-style-state.csv.

@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.

Domain-aware review (style sweep, fire.py)

Scope: 3-line dead-code/import cleanup plus a sweep-state CSV row. Verified the diff matches the stated intent.

Blockers: none.

Suggestions: none.

Nits: none.

Checks I ran:

  • log is gone from the import and has no remaining call sites in the module.
  • S_T local is removed; the only surviving S_T is in the ANDERSON_13 column-layout comment (line 47), which is correct to keep since the table column itself is unchanged. S_e/rho_p (the adjacent locals) are still read by the Rothermel math, so the deletion is surgical.
  • isort reflow of the xrspatial.utils block is a pure reordering; the imported names are identical before and after.
  • flake8 and isort are both clean on the file; pytest xrspatial/tests/test_fire.py is 54 passed. No runtime logic touched, so backend parity (numpy/cupy/dask) is unaffected by construction.

No behavioural change. Good to merge once CI is green.

@brendancol brendancol merged commit 5f0e4b8 into main Jun 19, 2026
10 checks passed
@brendancol brendancol deleted the deep-sweep-style-fire-2026-06-19 branch June 25, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Style: dead code + import-ordering drift in xrspatial/fire.py

1 participant