From d94131a2771f69e212e20da89374ddb0da87ed38 Mon Sep 17 00:00:00 2001 From: Sijia Wang Date: Tue, 19 May 2020 20:24:34 -0400 Subject: [PATCH] allow project card to write out "managed" from logfile --- lasso/roadway.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/lasso/roadway.py b/lasso/roadway.py index e3683a0..0e919fe 100644 --- a/lasso/roadway.py +++ b/lasso/roadway.py @@ -173,6 +173,7 @@ def create_calculated_variables(self): self.add_counts() self.create_ML_variable() self.create_hov_corridor_variable() + self.create_managed_variable() def calculate_county( self, @@ -1309,6 +1310,47 @@ def create_hov_corridor_variable( "Finished creating hov corridor variable: {}".format(network_variable) ) + def create_managed_variable( + self, + network_variable="managed", + overwrite=False, + ): + """ + Created placeholder for project to write out managed + + managed default to 0, its info comes from cube LOG file and store in project cards + + Args: + overwrite (Bool): True if overwriting existing variable in network. Default to False. + + Returns: + None + """ + if network_variable in self.links_df: + if overwrite: + WranglerLogger.info( + "Overwriting existing managed Variable '{}' already in network".format( + network_variable + ) + ) + else: + WranglerLogger.info( + "Managed Variable '{}' already in network. Returning without overwriting.".format( + network_variable + ) + ) + return + + """ + Verify inputs + """ + + self.links_df[network_variable] = int(0) + + WranglerLogger.info( + "Finished creating managed variable: {}".format(network_variable) + ) + def calculate_distance( self, network_variable = "distance",