mirror of
https://github.com/enzet/map-machine.git
synced 2025-06-13 00:02:19 +02:00
Fix documentation.
This commit is contained in:
parent
c7811a3218
commit
b2a071b4b3
6 changed files with 10 additions and 16 deletions
|
@ -1,6 +1,4 @@
|
||||||
"""
|
"""Map Machine entry point."""
|
||||||
Map Machine entry point.
|
|
||||||
"""
|
|
||||||
from map_machine.main import main
|
from map_machine.main import main
|
||||||
|
|
||||||
__author__ = "Sergey Vartanov"
|
__author__ = "Sergey Vartanov"
|
||||||
|
|
|
@ -74,9 +74,7 @@ def line_center(
|
||||||
|
|
||||||
|
|
||||||
def get_user_color(text: str, seed: str) -> Color:
|
def get_user_color(text: str, seed: str) -> Color:
|
||||||
"""
|
"""Generate random color based on text."""
|
||||||
Generate random color based on text.
|
|
||||||
"""
|
|
||||||
if text == "":
|
if text == "":
|
||||||
return Color("black")
|
return Color("black")
|
||||||
return Color("#" + sha256((seed + text).encode("utf-8")).hexdigest()[-6:])
|
return Color("#" + sha256((seed + text).encode("utf-8")).hexdigest()[-6:])
|
||||||
|
|
|
@ -43,9 +43,7 @@ def parse_text(text: str, margins: str, tag_id: str) -> Code:
|
||||||
|
|
||||||
|
|
||||||
class ArgumentParser(argparse.ArgumentParser):
|
class ArgumentParser(argparse.ArgumentParser):
|
||||||
"""
|
"""Parser that stores arguments and creates help in Moire markup."""
|
||||||
Argument parser that stores arguments and creates help in Moire markup.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs) -> None:
|
def __init__(self, *args, **kwargs) -> None:
|
||||||
self.arguments: list[dict[str, Any]] = []
|
self.arguments: list[dict[str, Any]] = []
|
||||||
|
|
|
@ -36,9 +36,7 @@ class WikiTable:
|
||||||
self.page_name: str = page_name
|
self.page_name: str = page_name
|
||||||
|
|
||||||
def generate_wiki_table(self) -> tuple[str, list[Icon]]:
|
def generate_wiki_table(self) -> tuple[str, list[Icon]]:
|
||||||
"""
|
"""Generate Röntgen icon table for the OpenStreetMap wiki page."""
|
||||||
Generate Röntgen icon table for the OpenStreetMap wiki page.
|
|
||||||
"""
|
|
||||||
icons: list[Icon] = []
|
icons: list[Icon] = []
|
||||||
text: str = '{| class="wikitable"\n'
|
text: str = '{| class="wikitable"\n'
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,7 @@ __email__ = "me@enzet.ru"
|
||||||
|
|
||||||
def pseudo_mercator(coordinates: np.ndarray) -> np.ndarray:
|
def pseudo_mercator(coordinates: np.ndarray) -> np.ndarray:
|
||||||
"""
|
"""
|
||||||
Use spherical pseudo-Mercator projection to convert geo coordinates into
|
Use spherical pseudo-Mercator projection to convert geo coordinates.
|
||||||
plane.
|
|
||||||
|
|
||||||
:param coordinates: geo positional in the form of (latitude, longitude)
|
:param coordinates: geo positional in the form of (latitude, longitude)
|
||||||
:return: position on the plane in the form of (x, y)
|
:return: position on the plane in the form of (x, y)
|
||||||
|
@ -29,8 +28,9 @@ def osm_zoom_level_to_pixels_per_meter(
|
||||||
zoom_level: float, equator_length: float
|
zoom_level: float, equator_length: float
|
||||||
) -> float:
|
) -> float:
|
||||||
"""
|
"""
|
||||||
Convert OSM zoom level to pixels per meter on Equator. See
|
Convert OSM zoom level to pixels per meter on Equator.
|
||||||
https://wiki.openstreetmap.org/wiki/Zoom_levels
|
|
||||||
|
See https://wiki.openstreetmap.org/wiki/Zoom_levels
|
||||||
|
|
||||||
:param zoom_level: integer number usually not bigger than 20, but this
|
:param zoom_level: integer number usually not bigger than 20, but this
|
||||||
function allows any non-negative float value
|
function allows any non-negative float value
|
||||||
|
|
|
@ -411,6 +411,8 @@ class Scheme:
|
||||||
|
|
||||||
def get(self, variable_name: str):
|
def get(self, variable_name: str):
|
||||||
"""
|
"""
|
||||||
|
Get value of variable.
|
||||||
|
|
||||||
FIXME: colors should be variables.
|
FIXME: colors should be variables.
|
||||||
"""
|
"""
|
||||||
if variable_name in self.colors:
|
if variable_name in self.colors:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue