mirror of
https://github.com/enzet/map-machine.git
synced 2025-06-02 10:51:57 +02:00
Fix warnings.
This commit is contained in:
parent
b358e56223
commit
1be9906baf
6 changed files with 13 additions and 11 deletions
|
@ -32,6 +32,8 @@
|
||||||
<w>rasterize</w>
|
<w>rasterize</w>
|
||||||
<w>rasterized</w>
|
<w>rasterized</w>
|
||||||
<w>röntgen</w>
|
<w>röntgen</w>
|
||||||
|
<w>subattributes</w>
|
||||||
|
<w>subelement</w>
|
||||||
<w>subparser</w>
|
<w>subparser</w>
|
||||||
<w>svgwrite</w>
|
<w>svgwrite</w>
|
||||||
<w>taginfo</w>
|
<w>taginfo</w>
|
||||||
|
|
|
@ -12,12 +12,6 @@ SHORT_MESSAGE_MAX_LENGTH: int = 50
|
||||||
MESSAGE_MAX_LENGTH: int = 72
|
MESSAGE_MAX_LENGTH: int = 72
|
||||||
|
|
||||||
|
|
||||||
def error(message: str):
|
|
||||||
"""Print error message and return exit code 1."""
|
|
||||||
print(f"Error: {message}")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
|
|
||||||
def check_file(file_name: str) -> Optional[str]:
|
def check_file(file_name: str) -> Optional[str]:
|
||||||
"""
|
"""
|
||||||
Exit program with exit code 1 if commit message does not conform the rules.
|
Exit program with exit code 1 if commit message does not conform the rules.
|
||||||
|
|
|
@ -146,14 +146,14 @@ class Map:
|
||||||
|
|
||||||
previous_height = height
|
previous_height = height
|
||||||
|
|
||||||
def draw_roads(self, roads: Iterator[Road]) -> None:
|
def draw_simple_roads(self, roads: Iterator[Road]) -> None:
|
||||||
"""Draw road as simple SVG path."""
|
"""Draw road as simple SVG path."""
|
||||||
nodes: dict[OSMNode, set[RoadPart]] = {}
|
nodes: dict[OSMNode, set[RoadPart]] = {}
|
||||||
|
|
||||||
for road in roads:
|
for road in roads:
|
||||||
for index in range(len(road.outers[0]) - 1):
|
for index in range(len(road.nodes) - 1):
|
||||||
node_1: OSMNode = road.outers[0][index]
|
node_1: OSMNode = road.nodes[index]
|
||||||
node_2: OSMNode = road.outers[0][index + 1]
|
node_2: OSMNode = road.nodes[index + 1]
|
||||||
point_1: np.ndarray = self.flinger.fling(node_1.coordinates)
|
point_1: np.ndarray = self.flinger.fling(node_1.coordinates)
|
||||||
point_2: np.ndarray = self.flinger.fling(node_2.coordinates)
|
point_2: np.ndarray = self.flinger.fling(node_2.coordinates)
|
||||||
scale: float = self.flinger.get_scale(node_1.coordinates)
|
scale: float = self.flinger.get_scale(node_1.coordinates)
|
||||||
|
|
|
@ -464,6 +464,7 @@ class Road(Tagged):
|
||||||
return style
|
return style
|
||||||
|
|
||||||
def get_filter(self, svg: Drawing, is_border: bool) -> Optional[Filter]:
|
def get_filter(self, svg: Drawing, is_border: bool) -> Optional[Filter]:
|
||||||
|
"""Get blurring filter."""
|
||||||
if not USE_BLUR:
|
if not USE_BLUR:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
"""
|
||||||
|
Check whether `requirements.txt` contains all requirements from `setup.py`.
|
||||||
|
"""
|
||||||
from map_machine import REQUIREMENTS
|
from map_machine import REQUIREMENTS
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
|
@ -25,4 +25,6 @@ def test_compute_angle() -> None:
|
||||||
|
|
||||||
def test_turn_by_compute_angle() -> None:
|
def test_turn_by_compute_angle() -> None:
|
||||||
"""Test turing one angle by another."""
|
"""Test turing one angle by another."""
|
||||||
assert np.allclose(turn_by_angle((1, 0), np.pi / 2), np.array((0, 1)))
|
assert np.allclose(
|
||||||
|
turn_by_angle(np.array((1, 0)), np.pi / 2), np.array((0, 1))
|
||||||
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue