Skip to content

Commit

Permalink
revert the quick fix in metcouncil prerelease
Browse files Browse the repository at this point in the history
  • Loading branch information
yueshuaing committed Oct 10, 2024
1 parent c7d9fe2 commit e37049f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions network_wrangler/roadway/links/df_accessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,19 @@ class LinkOfTypeAccessor:
def __init__(self, links_df: DataFrame[RoadLinksTable]):
"""LinkOfTypeAccessor for RoadLinksTable."""
self._links_df = links_df
# try:
# links_df.attrs["name"] == "road_links"
# except AttributeError:
# WranglerLogger.warning(
# "`of_type` should only be used on 'road_links' dataframes. \
# No attr['name'] not found."
# )
# except AssertionError:
# WranglerLogger.warning(
# f"`of_type` should only be used on 'road_links' dataframes. \
# Found type: {links_df.attr['name']}"
# )
# raise NotLinksError("`of_type` is only available to network_links dataframes.")
try:
links_df.attrs["name"] == "road_links"

Check failure on line 64 in network_wrangler/roadway/links/df_accessors.py

View workflow job for this annotation

GitHub Actions / build (3.9)

Ruff (B015)

network_wrangler/roadway/links/df_accessors.py:64:13: B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it.
except AttributeError:
WranglerLogger.warning(
"`of_type` should only be used on 'road_links' dataframes. \
No attr['name'] not found."
)
except AssertionError:
WranglerLogger.warning(
f"`of_type` should only be used on 'road_links' dataframes. \
Found type: {links_df.attr['name']}"
)
raise NotLinksError("`of_type` is only available to network_links dataframes.")

Check failure on line 75 in network_wrangler/roadway/links/df_accessors.py

View workflow job for this annotation

GitHub Actions / build (3.9)

Ruff (B904)

network_wrangler/roadway/links/df_accessors.py:75:13: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling

Check failure on line 75 in network_wrangler/roadway/links/df_accessors.py

View workflow job for this annotation

GitHub Actions / build (3.9)

Ruff (EM101)

network_wrangler/roadway/links/df_accessors.py:75:33: EM101 Exception must not use a string literal, assign to variable first

@property
def managed(self):
Expand Down

0 comments on commit e37049f

Please sign in to comment.