Skip to content

Commit

Permalink
overrides issue flagged by pyright
Browse files Browse the repository at this point in the history
  • Loading branch information
songololo committed Jan 28, 2023
1 parent 76ad356 commit b98f316
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cityseer/metrics/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def compute_accessibilities(
# these indices are passed as keys which will be matched against the integer landuse encodings
acc_keys: list[int] = []
for ac_label in accessibility_keys:
if ac_label not in lab_enc.classes_:
if ac_label not in lab_enc.classes_: # type: ignore
logger.warning(f"No instances of accessibility label '{ac_label}' in the data.")
else:
acc_keys.append(lab_enc.transform([ac_label])) # type: ignore
Expand Down Expand Up @@ -300,7 +300,7 @@ def compute_accessibilities(
ac_nw_data_key = config.prep_gdf_key(f"{ac_label}_{d_key}_non_weighted")
ac_wt_data_key = config.prep_gdf_key(f"{ac_label}_{d_key}_weighted")
# sometimes target classes are not present in data
if ac_label in lab_enc.classes_:
if ac_label in lab_enc.classes_: # type: ignore
ac_code: int = lab_enc.transform([ac_label]) # type: ignore
ac_idx: int = acc_keys.index(ac_code)
nodes_gdf[ac_nw_data_key] = accessibility_data[ac_idx][d_idx] # non-weighted
Expand Down
7 changes: 1 addition & 6 deletions cityseer/tools/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1634,12 +1634,7 @@ def recurse_child_keys(
# get starting geom for orientation
s_nd_data: NodeData = _multi_graph.nodes[start_nd_key]
s_nd_geom = geometry.Point(s_nd_data["x"], s_nd_data["y"])
if np.allclose(
s_nd_geom.coords,
new_edge_geom_a.coords[0][:2],
atol=config.ATOL,
rtol=0,
) or np.allclose(
if np.allclose(s_nd_geom.coords, new_edge_geom_a.coords[0][:2], atol=config.ATOL, rtol=0,) or np.allclose(
s_nd_geom.coords,
new_edge_geom_a.coords[-1][:2],
atol=config.ATOL,
Expand Down

0 comments on commit b98f316

Please sign in to comment.