Skip to content

Commit

Permalink
Addresses #128
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidOry committed Aug 16, 2021
1 parent 4a8fba3 commit eeab0fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 5 additions & 2 deletions lasso/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,9 @@ class Parameters:
::
r"tests/scratch/make_complete_network_from_fixed_width_file.s
zones (int): Number of travel analysis zones in the network. Default:
::
3061
"""

def __init__(self, **kwargs):
Expand Down Expand Up @@ -738,4 +739,6 @@ def __init__(self, **kwargs):
"ROUTE_SYS",
]

self.zones = 3061

self.__dict__.update(kwargs)
7 changes: 4 additions & 3 deletions lasso/roadway.py
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ def write_roadway_as_fixedwidth(

# write out cube script
s = 'RUN PGM = NETWORK MSG = "Read in network from fixed width file" \n'
s += "FILEI LINKI[1] = %LINK_DATA_PATH%,"
s += 'FILEI LINKI[1] = "{}",'.format(output_link_txt)
start_pos = 1
for i in range(len(link_max_width_df)):
s += " VAR=" + link_max_width_df.header.iloc[i]
Expand All @@ -1613,7 +1613,7 @@ def write_roadway_as_fixedwidth(

s = s[:-1]
s += "\n"
s += "FILEI NODEI[1] = %NODE_DATA_PATH%,"
s += 'FILEI NODEI[1] = "{}",'.format(output_node_txt)
start_pos = 1
for i in range(len(node_max_width_df)):
s += " VAR=" + node_max_width_df.header.iloc[i]
Expand All @@ -1636,7 +1636,8 @@ def write_roadway_as_fixedwidth(

s = s[:-1]
s += "\n"
s += 'FILEO NETO = "%SCENARIO_DIR%/complete_network.net" \n\n ZONES = %zones% \n\n'
s += 'FILEO NETO = "complete_network.net" \n\n'
s += 'ZONES = {} \n\n'.format(self.parameters.zones)
s += "ROADWAY = LTRIM(TRIM(ROADWAY)) \n"
s += "NAME = LTRIM(TRIM(NAME)) \n"
s += "\n \nENDRUN"
Expand Down

0 comments on commit eeab0fa

Please sign in to comment.