Skip to content

Style cleanup in viewshed.py: shadowed id builtin, E127, isort #2690

@brendancol

Description

@brendancol

A style sweep over xrspatial/viewshed.py turned up three issues, all reported by the project's own tooling (flake8 max-line-length=100, isort line_length=100) or by grep.

First, a shadowed id builtin: lines 1409 and 1474 do id = _pop(idle) and pass id into _insert_into_tree. That local shadows the id builtin. The value lands in the callee's node_id parameter, so renaming the local to node_id drops the shadow and matches the signature. It isn't used anywhere else.

Second, E127 over-indented continuation lines at 2013 and 2014, in the _viewshed_distance_sweep signature.

Third, the .utils import block isn't wrapped at line_length=100; isort --check-only --diff reports the fix.

After the fix, flake8 xrspatial/viewshed.py should report nothing and isort --check-only --diff xrspatial/viewshed.py should be clean. None of this changes runtime behavior, the id rename is just a local variable rename.

Metadata

Metadata

Assignees

No one assigned

    Labels

    QA/QCbugSomething isn't working

    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