Skip to content
This repository has been archived by the owner on Sep 1, 2021. It is now read-only.

Commit

Permalink
mypy: function doesn't have attributes that are assigned
Browse files Browse the repository at this point in the history
vertical and horizontal are missing from Callable. I am confused how
this will work. I've commented it out because mypy was flagging it and
it has not been used anywhere.
  • Loading branch information
Dilawar Singh committed Jul 24, 2021
1 parent 69dac1a commit 1b615c2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions epimargin/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ def choropleth(gdf, label_fn = lambda _: "", col = "Rt", title = "$R_t$", label_

return PlotDevice(fig)

def double_choropleth(gdf, label_fn = lambda _: "", Rt_col = "Rt", Rt_proj_col = "Rt_proj", titles = ["Current $R_t$", "Projected $R_t$ (1 Week)"], arrangement = (1, 2), label_kwargs = {}, mappable = sm):
def double_choropleth(gdf, label_fn = lambda _: "", Rt_col = "Rt", Rt_proj_col = "Rt_proj", titles = ["Current $R_t$", "Projected $R_t$ (1 Week)"], arrangement = (1, 2), label_kwargs = {}, mappable = sm) -> PlotDevice:
""" plot two choropleths side-by-side based on multiple metrics """
gdf["pt"] = gdf["geometry"].centroid
fig, (ax1, ax2) = plt.subplots(*arrangement)
Expand Down Expand Up @@ -550,5 +550,7 @@ def double_choropleth_v(*args, **kwargs):
kwargs["arrangement"] = (2, 1)
return double_choropleth(*args, **kwargs)

double_choropleth.horizontal = double_choropleth
double_choropleth.vertical = double_choropleth_v

# FIXME: lambda x: PlotDevice(...) does not have vertical or horizontal properties
# double_choropleth.horizontal = double_choropleth
# double_choropleth.vertical = double_choropleth_v

0 comments on commit 1b615c2

Please sign in to comment.