Skip to content

Commit

Permalink
allow project card to write out "managed" from logfile
Browse files Browse the repository at this point in the history
  • Loading branch information
i-am-sijia committed May 20, 2020
1 parent de7e29a commit d94131a
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions lasso/roadway.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand Down

1 comment on commit d94131a

@i-am-sijia
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#73

Please sign in to comment.