Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
xoolive committed Dec 13, 2024
1 parent f487493 commit aeddc12
Show file tree
Hide file tree
Showing 4 changed files with 847 additions and 724 deletions.
2 changes: 1 addition & 1 deletion src/traffic/core/flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -2967,7 +2967,7 @@ def chart(self, *features: str) -> "alt.Chart": # coverage: ignore
list(features), as_=["variable", "value"]
).encode(alt.Y("value:Q"), alt.Color("variable:N"))

return base.mark_line()
return base.mark_line() # type: ignore

# -- Visualize with Leaflet --

Expand Down
8 changes: 5 additions & 3 deletions src/traffic/core/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,9 @@ def geoencode(
import altair as alt

data = alt.Data(values=self.geojson()) # type: ignore
return alt.Chart(data).mark_geoshape(stroke="#aaaaaa", **kwargs)
return alt.Chart(data).mark_geoshape( # type: ignore
stroke="#aaaaaa", **kwargs
)

def project_shape(
self, projection: None | pyproj.Proj | "crs.Projection" = None
Expand Down Expand Up @@ -655,7 +657,7 @@ def geoencode(self, **kwargs: Any) -> "alt.Chart": # coverage: ignore
"""
import altair as alt

return (
return ( # type: ignore
alt.Chart(
self.data.query("latitude.notnull() and longitude.notnull()")
)
Expand Down Expand Up @@ -859,7 +861,7 @@ def geoencode(self, **kwargs: Any) -> "alt.Chart": # coverage: ignore
"""
import altair as alt

return (
return ( # type: ignore
alt.Chart(self.data)
.mark_circle(**kwargs)
.encode(
Expand Down
8 changes: 4 additions & 4 deletions src/traffic/data/basic/runways.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def geoencode(self, **kwargs: Any) -> "alt.Chart": # coverage: ignore
if kwargs.get("mode", None) == "geometry":
params = {**{"strokeWidth": 4, "stroke": "black"}, **kwargs}
del params["mode"]
return super().geoencode().mark_geoshape(**params)
return super().geoencode().mark_geoshape(**params) # type: ignore
elif kwargs.get("mode", None) == "labels":
params = {
**{"baseline": "middle", "dy": 20, "fontSize": 18},
Expand All @@ -162,9 +162,9 @@ def geoencode(self, **kwargs: Any) -> "alt.Chart": # coverage: ignore
longitude="longitude:Q", latitude="latitude:Q", text="name:N"
)
rwy_layers = [
rwy_labels.transform_filter(
alt.datum.name == name # type: ignore
).mark_text(angle=bearing, **params)
rwy_labels.transform_filter(alt.datum.name == name).mark_text(
angle=bearing, **params
)
for (name, bearing) in zip(self.data.name, self.data.bearing)
]

Expand Down
Loading

0 comments on commit aeddc12

Please sign in to comment.