Skip to content

Commit

Permalink
Merge pull request #23 from naviqore/release/v0.5.1
Browse files Browse the repository at this point in the history
Release/v0.5.1
  • Loading branch information
munterfi authored Sep 17, 2024
2 parents e52f3e1 + 99aac46 commit 2c03e40
Show file tree
Hide file tree
Showing 10 changed files with 1,030 additions and 1,027 deletions.
2,006 changes: 1,003 additions & 1,003 deletions poetry.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions public_transit_viewer/components/form_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ def _get_number_value(input_value: Any) -> int | None:


def query_config_expandable(
default_max_transfers: int = -1,
default_max_walking_duration: int = -1,
default_max_travel_time: int = -1,
default_min_transfer_time: int = -1,
wheelchair_accessible: bool = False,
bikes_allowed: bool = False,
travel_modes: list[str] | None = None,
default_max_transfers: int = -1,
default_max_walking_duration: int = -1,
default_max_travel_time: int = -1,
default_min_transfer_time: int = -1,
wheelchair_accessible: bool = False,
bikes_allowed: bool = False,
travel_modes: list[str] | None = None,
) -> tuple[
int | None,
int | None,
Expand Down
7 changes: 4 additions & 3 deletions public_transit_viewer/components/logo.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import streamlit as st
import base64

import streamlit as st

from public_transit_viewer import LOGO_PATH

def show_logo(max_width: int = 150, padding: int = 15) -> None:

def show_logo(max_width: int = 150, padding: int = 15) -> None:
image = LOGO_PATH.read_bytes()
base64_image = base64.b64encode(image).decode()

Expand All @@ -21,4 +22,4 @@ def show_logo(max_width: int = 150, padding: int = 15) -> None:
<img src="data:image/png;base64,{base64_image}" class="logo-image"/>
</div>
"""
)
)
7 changes: 3 additions & 4 deletions public_transit_viewer/components/map.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import streamlit.components.v1 as components
import html
from folium import Map, Marker, Circle, PolyLine, Popup, Tooltip, Icon # type: ignore
from typing import Any

import streamlit.components.v1 as components
from folium import Circle, Icon, Map, Marker, PolyLine, Popup, Tooltip # type: ignore

def display_map(map: Map, height: int = 400) -> None:

def display_map(map: Map, height: int = 400) -> None:
zoom: int = map.options.get("zoom", 10) # type: ignore

children = _create_children_js(map)
Expand Down Expand Up @@ -56,7 +56,6 @@ def display_map(map: Map, height: int = 400) -> None:


def _create_children_js(map: Map) -> str:

children = ""

for name, child in map._children.items(): # type: ignore
Expand Down
1 change: 0 additions & 1 deletion public_transit_viewer/pages/isolines.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ def show_marker_and_lines(
target_coordinates: list[float] = [data_row["targetLat"], data_row["targetLon"]]

if show_markers:

stop_col = "targetStop" if time_type == TimeType.DEPARTURE else "sourceStop"
popup = f"{data_row[stop_col]} - {data_row['durationFromSourceInMinutes']} min"

Expand Down
2 changes: 1 addition & 1 deletion public_transit_viewer/utils/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
QueryConfig,
RouterInfo,
ScheduleInfo,
SearchType,
Stop,
StopConnection,
TimeType,
TransportMode,
SearchType,
)

LOG = logging.getLogger(__name__)
Expand Down
10 changes: 5 additions & 5 deletions public_transit_viewer/utils/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@


def get_color_map_hex_value(
value: float,
min_value: float,
max_value: float,
num_color_steps: int = 32,
color_map: str = "hsv",
value: float,
min_value: float,
max_value: float,
num_color_steps: int = 32,
color_map: str = "hsv",
) -> str:
"""Get hexadecimal color value based on value and color map.
Expand Down
1 change: 1 addition & 0 deletions public_transit_viewer/utils/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import folium # type: ignore
import streamlit as st
from public_transit_client.model import Connection, Leg

from public_transit_viewer.components.map import display_map

stop_icon_args = {
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "public-transit-viewer"
version = "0.5.0"
version = "0.5.1"
description = "Viewer to interact with the public transit service."
authors = [
"Lukas Connolly <[email protected]>",
Expand All @@ -16,7 +16,7 @@ python-dotenv = "^1.0.1"
matplotlib = "^3.9.2"
pandas = "^2.2.2"
pydantic = "^2.8.2"
streamlit = "^1.34,<1.35"
streamlit = "^1.34,<1.35"
streamlit-searchbox = "^0.1.14"
folium = "^0.17.0"
watchdog = "^4.0.2"
Expand All @@ -32,6 +32,9 @@ pandas-stubs = "^2.2.2.240807"
[tool.poetry.scripts]
ptv-deploy = "public_transit_viewer.entrypoint:main"

[tool.isort]
profile = "black"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
2 changes: 1 addition & 1 deletion tests/test_entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_main():

# Check that the process has ended
assert (
process.returncode == 0 or process.returncode == -signal.SIGTERM
process.returncode == 0 or process.returncode == -signal.SIGTERM
), "Process did not terminate as expected"

finally:
Expand Down

0 comments on commit 2c03e40

Please sign in to comment.