Skip to content

Commit

Permalink
refactor: make pyright happy
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorozenko committed Apr 29, 2024
1 parent 165a605 commit 62de851
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions respiratory_disease_tapyr/helpers/map_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ def add_circles(geodata: DataFrame, circle_layer: LayerGroup) -> None:
circle_layer.clear_layers()
circle_markers = []
for _, row in geodata.iterrows():
popup = HTML(f"<b>{row.Entity}:</b></br>" + str(round(row["Death.Rate"], 2)))
popup = HTML(f"<b>{row.Entity}:</b></br>" + str(round(float(row["Death.Rate"]), 2)))
circle_marker = CircleMarker(
location=[row["lat"], row["lng"]],
radius=determine_circle_radius(row["Death.Rate"]),
radius=determine_circle_radius(float(row["Death.Rate"])),
weight=1,
color="white",
opacity=0.7,
fill_color=determine_circle_color(row["PM2.5"]),
fill_color=determine_circle_color(float(row["PM2.5"])),
fill_opacity=0.5,
popup=popup,
)
Expand Down Expand Up @@ -107,7 +107,7 @@ def add_polygons(


def filter_data(data: DataFrame, year: int) -> DataFrame:
return data[data["Year"] == year]
return data.loc[data["Year"] == year]


def dataframe_to_geojson(df: DataFrame) -> dict:
Expand Down
4 changes: 2 additions & 2 deletions respiratory_disease_tapyr/helpers/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def create_figure(
title: str,
labels: dict,
) -> go.FigureWidget:
plot_data = data[data["Year"].between(year_range[0], year_range[1])]
plot_data = plot_data[plot_data["Entity"].isin(country)]
plot_data = data.loc[data["Year"].between(year_range[0], year_range[1])]
plot_data = plot_data.loc[plot_data["Entity"].isin(country)]

fig = px.line(
data_frame=plot_data,
Expand Down

0 comments on commit 62de851

Please sign in to comment.