Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment out momepy temporarily and ruff check #314

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions modules/createAIM/GeoJSON_to_ASSET/GeoJSON_to_ASSET.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import argparse # noqa: INP001, D100
import argparse # noqa: D100, INP001
import importlib
import json
import os
Expand All @@ -8,7 +8,8 @@
import warnings

import geopandas as gpd
import momepy

# import momepy
import numpy as np
import pandas as pd
import shapely
Expand Down Expand Up @@ -179,10 +180,10 @@ def defineConnectivities( # noqa: N802, D102
# Convert find connectivity and add start_node, end_node attributes
edges = self.gdf
datacrs = edges.crs
graph = momepy.gdf_to_nx(edges.to_crs('epsg:6500'), approach='primal')
graph = momepy.gdf_to_nx(edges.to_crs('epsg:6500'), approach='primal') # noqa: F821
with warnings.catch_warnings(): # Suppress the warning of disconnected components in the graph
warnings.simplefilter('ignore')
nodes, edges, sw = momepy.nx_to_gdf(
nodes, edges, sw = momepy.nx_to_gdf( # noqa: F821
graph, points=True, lines=True, spatial_weights=True
)
# edges = edges.set_index('ind')
Expand Down
9 changes: 5 additions & 4 deletions modules/createAIM/INP_FILE/INP_FILE.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import argparse # noqa: INP001, D100
import argparse # noqa: D100, INP001
import importlib
import json
import os
Expand All @@ -8,7 +8,8 @@
import warnings

import geopandas as gpd
import momepy

# import momepy
import numpy as np
import pandas as pd
import shapely
Expand Down Expand Up @@ -179,10 +180,10 @@ def defineConnectivities( # noqa: N802, D102
# Convert find connectivity and add start_node, end_node attributes
edges = self.gdf
datacrs = edges.crs
graph = momepy.gdf_to_nx(edges.to_crs('epsg:6500'), approach='primal')
graph = momepy.gdf_to_nx(edges.to_crs('epsg:6500'), approach='primal') # noqa: F821
with warnings.catch_warnings(): # Suppress the warning of disconnected components in the graph
warnings.simplefilter('ignore')
nodes, edges, sw = momepy.nx_to_gdf(
nodes, edges, sw = momepy.nx_to_gdf( # noqa: F821
graph, points=True, lines=True, spatial_weights=True
)
# edges = edges.set_index('ind')
Expand Down
7 changes: 4 additions & 3 deletions modules/createAIM/JSON_to_AIM/JSON_to_AIM_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
import warnings

import geopandas as gpd
import momepy

# import momepy
import numpy as np
import pandas as pd
import shapely
Expand Down Expand Up @@ -358,10 +359,10 @@ def create_asset_files( # noqa: C901, D103, PLR0915
roadDF['geometry'] = LineStringList
roadDF = roadDF[['ID', 'roadType', 'lanes', 'maxMPH', 'geometry']] # noqa: N806
roadGDF = gpd.GeoDataFrame(roadDF, geometry='geometry', crs=datacrs) # noqa: N806
graph = momepy.gdf_to_nx(roadGDF.to_crs('epsg:6500'), approach='primal')
graph = momepy.gdf_to_nx(roadGDF.to_crs('epsg:6500'), approach='primal') # noqa: F821
with warnings.catch_warnings(): # Suppress the warning of disconnected components in the graph
warnings.simplefilter('ignore')
nodes, edges, sw = momepy.nx_to_gdf(
nodes, edges, sw = momepy.nx_to_gdf( # noqa: F821
graph, points=True, lines=True, spatial_weights=True
)
# Oneway or twoway is not considered in D&L, remove duplicated edges
Expand Down
Loading