Skip to content

Commit

Permalink
Merge branch 'hotfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
jinyan1214 committed Sep 6, 2024
2 parents 45e2987 + 416e232 commit 85454eb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
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

0 comments on commit 85454eb

Please sign in to comment.