Skip to content

Commit

Permalink
update metcouncil model net output columns
Browse files Browse the repository at this point in the history
  • Loading branch information
i-am-sijia committed Apr 18, 2022
1 parent db76ac4 commit 7aa12da
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
9 changes: 5 additions & 4 deletions lasso/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,17 +670,18 @@ def __init__(self, **kwargs):
"geometry",
"X",
"Y",
"ML_lanes_AM",
"ML_lanes_MD",
"ML_lanes_PM",
"ML_lanes_NT",
#"ML_lanes_AM",
#"ML_lanes_MD",
#"ML_lanes_PM",
#"ML_lanes_NT",
"segment_id",
"managed",
"bus_only",
"rail_only",
"bike_facility",
"mrcc_id",
"ROUTE_SYS", #mrcc functional class
"MNPASS_COD",
]

self.output_link_shp = os.path.join(self.scratch_location, "links.shp")
Expand Down
10 changes: 9 additions & 1 deletion lasso/roadway.py
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,15 @@ def convert_int(self, int_col_names=[]):
raise ValueError(msg)

for c in list(set(self.nodes_df.columns) & set(int_col_names)):
self.nodes_df[c] = self.nodes_df[c].astype(int)
self.nodes_df[c] = self.nodes_df[c].replace(np.nan, 0)
# REPLACE BLANKS WITH ZERO FOR INTEGER COLUMNS
self.nodes_df[c] = self.nodes_df[c].replace('', 0)
try:
self.nodes_df[c] = self.nodes_df[c].astype(int)
except ValueError:
msg = f"Could not convert column {c} to integer."
WranglerLogger.error(msg)
raise ValueError(msg)

def fill_na(self):
"""
Expand Down

0 comments on commit 7aa12da

Please sign in to comment.