Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] authored Apr 2, 2024
1 parent 2716c1d commit f336d85
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
files: 'momepy\/'
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.11"
rev: "v0.3.5"
hooks:
- id: ruff
- id: ruff-format
Expand Down
1 change: 0 additions & 1 deletion momepy/coins.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@


class COINS:

"""
Calculates natural continuity and hierarchy of street networks in a given
GeoDataFrame using the COINS algorithm.
Expand Down
1 change: 0 additions & 1 deletion momepy/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,6 @@ def __init__(


class Alignment:

"""
Calculate the mean deviation of solar orientation of objects on adjacent cells
from an object.
Expand Down
10 changes: 5 additions & 5 deletions momepy/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ def preprocess(
geoms.append(blg[blg["mm_uid"] == j].iloc[0].geometry)
blg.drop(blg[blg["mm_uid"] == j].index[0], inplace=True)
new_geom = shapely.ops.unary_union(geoms)
blg.loc[
blg.loc[blg["mm_uid"] == key].index[0], blg.geometry.name
] = new_geom
blg.loc[blg.loc[blg["mm_uid"] == key].index[0], blg.geometry.name] = (
new_geom
)

blg.drop(delete, inplace=True)
return blg[buildings.columns]
Expand Down Expand Up @@ -1237,10 +1237,10 @@ def _get_rebuilt_edges(
"""
# Determine what endpoints were made into clusters:
edges_gdf["origin_cluster"] = edges_gdf[edge_from_att].apply(
lambda u: nodes_dict[u] if u in nodes_dict else -1
lambda u: nodes_dict.get(u, -1)
)
edges_gdf["destination_cluster"] = edges_gdf[edge_to_att].apply(
lambda v: nodes_dict[v] if v in nodes_dict else -1
lambda v: nodes_dict.get(v, -1)
)

# Determine what edges need to be simplified (either between diff.
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ momepy = ["datasets/bubenec.gpkg", "datasets/tests.gpkg"]

[tool.ruff]
line-length = 88
select = ["E", "F", "W", "I", "UP", "N", "B", "A", "C4", "SIM", "ARG"]
ignore = ["B006", "F403", "SIM108"]
lint.select = ["E", "F", "W", "I", "UP", "N", "B", "A", "C4", "SIM", "ARG"]
lint.ignore = ["B006", "F403", "SIM108"]
exclude = ["momepy/tests/*", "docs/*", "benchmarks/*"]

[tool.coverage.run]
Expand Down

0 comments on commit f336d85

Please sign in to comment.