Skip to content

aspect.py: flake8 E402/E305/E501 violations from a misplaced import block #2683

@brendancol

Description

@brendancol

Description

flake8 xrspatial/aspect.py (repo setup.cfg, max-line-length=100) reports four violations:

xrspatial/aspect.py:38:1: E305 expected 2 blank lines after class or function definition, found 1
xrspatial/aspect.py:38:1: E402 module level import not at top of file
xrspatial/aspect.py:219:101: E501 line too long (101 > 100 characters)
xrspatial/aspect.py:263:101: E501 line too long (109 > 100 characters)

The E402 and E305 share a cause: the from xrspatial.geodesic import (...) block at line 38 sits below the _geodesic_cuda_dims function (lines 29-36) instead of with the other top-of-file imports.

The two E501 lines are over-long _run_gpu_geodesic_aspect[griddim, blockdim](...) kernel-launch calls.

Proposed fix

  • Move the xrspatial.geodesic import up with the other top-of-file imports. Resolves E402 and E305.
  • Wrap the two long kernel-launch lines. Resolves both E501.

No behavioural change. Not applying isort reordering: slope.py and curvature.py use one-import-per-line for xrspatial.utils, and raw isort would collapse that and make aspect inconsistent with them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething 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