Skip to content

Shapely never used for has_line_of_sight, even if installed #1066

@bunny-therapist

Description

@bunny-therapist

Bug Report

Actual behavior:

The function has_line_of_sight in paths_shapely.py is not used, even if shapely is installed.

Expected behavior:

If shapely is installed, the functions in paths_shapely.py should be used, otherwise those in paths_python.py

Steps to reproduce/example code:

Have shapely installed, use has_line_of_sight. You can put a break point or print statement in the functions to see which one gets called.

I found this by putting print statements to check if shapely is installed, and in has_line_of_sight. I think the problem is this part in paths.py:

if 'shapely' in sys.modules:
    from .paths_python import has_line_of_sight  # noqa: F401
else:
    from .paths_python import has_line_of_sight  # noqa: F401

The code is the same in both branches. Clearly, the intended behavior is as in geometry.py, where it actually selects the shapely functions.

Metadata

Metadata

Assignees

No one assigned

    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