Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions arcade/geometry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,26 @@
are_lines_intersecting,
is_point_in_box,
)
try:

# Shapely is disabled due to https://github.com/pythonarcade/arcade/pull/1535
# We are leaving the code in-place to make it easier for someone to revisit
# in the future and improve shapely's performance.
use_shapely = False
# try:
# import shapely # noqa: F401
# use_shapely = True
# except ImportError:
# use_shapely = False
if use_shapely:
from .geometry_shapely import (
are_polygons_intersecting,
is_point_in_polygon,
)
shapely_installed = True
except ImportError:
else:
from .geometry_python import (
are_polygons_intersecting,
is_point_in_polygon,
)
shapely_installed = False


__all__ = [
"are_polygons_intersecting",
Expand Down
9 changes: 6 additions & 3 deletions arcade/paths.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
"""
Classic A-star algorithm for path finding.
"""
import sys
from arcade.types import Point
from arcade import check_for_collision_with_list, SpriteList, Sprite
from typing import Union, List, Tuple, Set, Optional

if 'shapely' in sys.modules:
try:
import shapely # noqa: F401
use_shapely = True
except ImportError:
use_shapely = False
if use_shapely:
from .paths_shapely import has_line_of_sight # noqa: F401
else:
from .paths_python import has_line_of_sight # noqa: F401


def _spot_is_blocked(position: Point,
moving_sprite: Sprite,
blocking_sprites: SpriteList) -> bool:
Expand Down