Skip to content

Commit aec6669

Browse files
committed
quick fix for metcouncil pre-release
need to revisit it later to fix them properly
1 parent fed524b commit aec6669

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

network_wrangler/configs/wrangler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ class IdGenerationConfig(ConfigItem):
135135
TRANSIT_SHAPE_ID_SCALAR: int = 1000000
136136
ROAD_SHAPE_ID_METHOD: Literal["scalar"] = "scalar"
137137
ROAD_SHAPE_ID_SCALAR: int = 1000
138-
ML_LINK_ID_METHOD: Literal["range", "scalar"] = "range"
138+
ML_LINK_ID_METHOD: Literal["range", "scalar"] = "scalar"
139139
ML_LINK_ID_RANGE: tuple[int, int] = (950000, 999999)
140-
ML_LINK_ID_SCALAR: int = 15000
140+
ML_LINK_ID_SCALAR: int = 2000000
141141
ML_NODE_ID_METHOD: Literal["range", "scalar"] = "range"
142142
ML_NODE_ID_RANGE: tuple[int, int] = (950000, 999999)
143143
ML_NODE_ID_SCALAR: int = 15000

network_wrangler/roadway/links/df_accessors.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,19 @@ class LinkOfTypeAccessor:
6060
def __init__(self, links_df: DataFrame[RoadLinksTable]):
6161
"""LinkOfTypeAccessor for RoadLinksTable."""
6262
self._links_df = links_df
63-
try:
64-
links_df.attrs["name"] == "road_links"
65-
except AttributeError:
66-
WranglerLogger.warning(
67-
"`of_type` should only be used on 'road_links' dataframes. \
68-
No attr['name'] not found."
69-
)
70-
except AssertionError:
71-
WranglerLogger.warning(
72-
f"`of_type` should only be used on 'road_links' dataframes. \
73-
Found type: {links_df.attr['name']}"
74-
)
75-
raise NotLinksError("`of_type` is only available to network_links dataframes.")
63+
# try:
64+
# links_df.attrs["name"] == "road_links"
65+
# except AttributeError:
66+
# WranglerLogger.warning(
67+
# "`of_type` should only be used on 'road_links' dataframes. \
68+
# No attr['name'] not found."
69+
# )
70+
# except AssertionError:
71+
# WranglerLogger.warning(
72+
# f"`of_type` should only be used on 'road_links' dataframes. \
73+
# Found type: {links_df.attr['name']}"
74+
# )
75+
# raise NotLinksError("`of_type` is only available to network_links dataframes.")
7676

7777
@property
7878
def managed(self):

network_wrangler/roadway/selection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def _perform_selection(self):
261261
WranglerLogger.info(f"Final selected links: {len(_selected_links_df)}")
262262
if len(_selected_links_df) < 10:
263263
WranglerLogger.debug(
264-
f"\n{_selected_links_df[_selected_links_df.attrs['display_cols']]}"
264+
f"\n{_selected_links_df}"
265265
)
266266

267267
return _selected_links_df

network_wrangler/scenario.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ def extract_base_scenario_metadata(base_scenario: dict) -> dict:
956956
_skip_copy = ["road_net", "transit_net", "config"]
957957
out_dict = {k: v for k, v in base_scenario.items() if k not in _skip_copy}
958958
if isinstance(base_scenario.get("road_net"), RoadwayNetwork):
959-
nodes_file_path = base_scenario["road_net"].nodes_df.attrs["source_file"]
959+
nodes_file_path = base_scenario["road_net"].nodes_df.attrs.get("source_file", None)
960960
if nodes_file_path is not None:
961961
out_dict["roadway"] = {
962962
"dir": str(Path(nodes_file_path).parent),

0 commit comments

Comments
 (0)