Skip to content

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

@brendancol

Description

@brendancol

xrspatial/fire.py has a few dead-code leftovers from a refactor. The project's own linters catch them, but neither flake8 nor isort runs in CI, so the drift sits there unnoticed.

flake8 (setup.cfg, max-line-length=100):

  • fire.py:20:1 F401 'math.log' imported but unused
  • fire.py:105:5 F841 local variable 'S_T' assigned but never used

isort (line_length=100):

  • The xrspatial.utils import block uses the one-per-line layout; isort wants the grid layout. One reordering diff.

Both F-code findings are dead code. log is never called in the module. S_T (total mineral content, row[5] of the Anderson-13 table) gets read into a local in _rothermel_fuel_constants and then nothing uses it. The neighbouring S_e and rho_p locals are used; only S_T is dead. The column itself stays in ANDERSON_13 and its documenting comment, so this only drops the unused binding.

Fix: drop log from the math import, delete the S_T local, and let isort reorder the utils import. No behaviour change, and nothing here touches runtime logic so it applies the same across the numpy/cupy/dask paths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions