From eeab0fab84c7c882a1318dcbc4a87829766d9c4b Mon Sep 17 00:00:00 2001 From: David Ory Date: Mon, 16 Aug 2021 14:27:41 -0600 Subject: [PATCH] Addresses #128 --- lasso/parameters.py | 7 +++++-- lasso/roadway.py | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lasso/parameters.py b/lasso/parameters.py index dc6fc0b..823e6b7 100644 --- a/lasso/parameters.py +++ b/lasso/parameters.py @@ -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): @@ -738,4 +739,6 @@ def __init__(self, **kwargs): "ROUTE_SYS", ] + self.zones = 3061 + self.__dict__.update(kwargs) diff --git a/lasso/roadway.py b/lasso/roadway.py index 38514be..07f044d 100644 --- a/lasso/roadway.py +++ b/lasso/roadway.py @@ -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] @@ -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] @@ -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"