From e8ae3f3fcdbbf5649e345575881cbc9f4231a194 Mon Sep 17 00:00:00 2001 From: Sijia Wang Date: Mon, 12 Aug 2024 12:38:02 -0400 Subject: [PATCH] blacken --- tm2py/components/network/create_tod_scenarios.py | 2 +- tm2py/components/network/highway/highway_assign.py | 14 ++++++++++---- tm2py/config.py | 10 +++++----- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/tm2py/components/network/create_tod_scenarios.py b/tm2py/components/network/create_tod_scenarios.py index 3a411cbd..7732d013 100644 --- a/tm2py/components/network/create_tod_scenarios.py +++ b/tm2py/components/network/create_tod_scenarios.py @@ -171,7 +171,7 @@ def _create_highway_scenarios(self): "(el1 + 60 * (0.25 * (put((volau + volad)/el2) - 1 + " "((get(1) - 1) ** 2 + el3 * get(1)) ** 0.5)))" ) - + for f_id in ["fd1", "fd2"]: if emmebank.function(f_id): emmebank.delete_function(f_id) diff --git a/tm2py/components/network/highway/highway_assign.py b/tm2py/components/network/highway/highway_assign.py index ba7f5742..1dbd9f9a 100644 --- a/tm2py/components/network/highway/highway_assign.py +++ b/tm2py/components/network/highway/highway_assign.py @@ -148,7 +148,9 @@ def run(self): iteration = self.controller.iteration warmstart = self.controller.config.warmstart.warmstart assign_classes = [ - AssignmentClass(c, time, iteration, calculate_reliability, warmstart) + AssignmentClass( + c, time, iteration, calculate_reliability, warmstart + ) for c in self.config.classes ] if iteration > 0: @@ -163,7 +165,7 @@ def run(self): assign_spec = self._get_assignment_spec( assign_classes, path_analysis=False ) - + with self.logger.log_start_end( "Run SOLA assignment without path analyses", level="INFO" ): @@ -177,7 +179,9 @@ def run(self): exf_pars = scenario.emmebank.extra_function_parameters vdfs = [ - f for f in scenario.emmebank.functions() if f.type == "VOLUME_DELAY" + f + for f in scenario.emmebank.functions() + if f.type == "VOLUME_DELAY" ] for function in vdfs: expression = function.expression @@ -198,7 +202,9 @@ def run(self): "(@static_rel+" + reliability_expr, {"link": "vdf=%s" % function.id[2:]}, ) - net_calc("@reliability_sq", "@reliability**2", {"link": "all"}) + net_calc( + "@reliability_sq", "@reliability**2", {"link": "all"} + ) assign_spec = self._get_assignment_spec( assign_classes, path_analysis=True diff --git a/tm2py/config.py b/tm2py/config.py index ee9f0273..adbf06bb 100644 --- a/tm2py/config.py +++ b/tm2py/config.py @@ -87,7 +87,7 @@ class WarmStartConfig(ConfigItem): Note that the components will be executed in the order listed. Properties: - warmstart: Boolean indicating whether warmstart demand matrices are used. + warmstart: Boolean indicating whether warmstart demand matrices are used. If set to True, the global iteration 0 will either assign warmstart demand for highway and transit, or skip the assignment and just use warmstart skims. If set to False, the global iteration 0 will assign zero demand for highway and transit. warmstart_skim: Boolean indicating whether to use warmstart skims. If set to True, then skips warmstart assignment in iteraton 0. @@ -952,10 +952,10 @@ class HighwayConfig(ConfigItem): to the free-flow speed, capacity, and critical speed values interchange_nodes_file: relative path to the interchange nodes file, this is used for calculating highway reliability - reliability: bool to skim highway reliability. Default to true. If true, assignment - will be run twice in global iterations 0 (warmstart) and 1, to calculate reliability, - assignment will be run only once in global iterations 2 and 3, - reliability skim will stay the same as global iteration 1. + reliability: bool to skim highway reliability. Default to true. If true, assignment + will be run twice in global iterations 0 (warmstart) and 1, to calculate reliability, + assignment will be run only once in global iterations 2 and 3, + reliability skim will stay the same as global iteration 1. If false, reliability will not be calculated nor skimmed in all global iterations, and the resulting reliability skims will be 0. """