From 7d0067868d26adaec98e71750ab855e576d51040 Mon Sep 17 00:00:00 2001 From: Ashish Kulshrestha Date: Mon, 22 Apr 2024 10:52:32 -0700 Subject: [PATCH] black --- tm2py/acceptance/acceptance.py | 15 +------- tm2py/acceptance/canonical.py | 11 ------ tm2py/acceptance/observed.py | 18 ---------- tm2py/acceptance/simulated.py | 36 ++----------------- tm2py/components/demand/commercial.py | 2 -- tm2py/components/demand/internal_external.py | 2 -- tm2py/components/demand/prepare_demand.py | 1 - .../network/create_tod_scenarios.py | 10 ++---- tm2py/components/network/skims.py | 1 - .../network/transit/transit_assign.py | 14 ++++---- tm2py/components/time_of_day.py | 1 - tm2py/controller.py | 1 - tm2py/matrix.py | 1 - 13 files changed, 14 insertions(+), 99 deletions(-) diff --git a/tm2py/acceptance/acceptance.py b/tm2py/acceptance/acceptance.py index 61362267..28ece345 100644 --- a/tm2py/acceptance/acceptance.py +++ b/tm2py/acceptance/acceptance.py @@ -12,7 +12,6 @@ class Acceptance: - s: Simulated o: Observed c: Canonical @@ -77,7 +76,7 @@ class Acceptance: "technology": pd.Series(dtype="str"), "route_short_name": pd.Series(dtype="str"), "route_long_name": pd.Series(dtype="str"), - #"trip_headsign": pd.Series(dtype="str"), + # "trip_headsign": pd.Series(dtype="str"), "time_period": pd.Series(dtype="str"), "route_observed_boardings": pd.Series(dtype="float"), "route_simulated_boardings": pd.Series(dtype="float"), @@ -133,7 +132,6 @@ def make_acceptance(self, make_transit=True, make_roadway=True, make_other=False return def _write_roadway_network(self): - file_root = self.acceptance_output_folder_root out_file = os.path.join(file_root, self.output_roadway_filename) self.road_network_gdf.to_file(out_file, driver="GeoJSON") @@ -141,7 +139,6 @@ def _write_roadway_network(self): return def _write_transit_network(self): - file_root = self.acceptance_output_folder_root out_file = os.path.join(file_root, self.output_transit_filename) self.transit_network_gdf.to_file(out_file, driver="GeoJSON") @@ -149,7 +146,6 @@ def _write_transit_network(self): return def _write_other_comparisons(self): - file_root = self.acceptance_output_folder_root out_file = os.path.join(file_root, self.output_other_filename) self.compare_gdf.to_file(out_file, driver="GeoJSON") @@ -157,7 +153,6 @@ def _write_other_comparisons(self): return def _make_roadway_network_comparisons(self): - o_df = self.o.reduced_traffic_counts_df.copy() o_trans_df = self.o.observed_bridge_transactions_df.copy() s_df = self.s.simulated_roadway_assignment_results_df.copy() @@ -391,7 +386,6 @@ def compare_transit_boardings(self) -> pd.DataFrame: return boards_df def _make_transit_network_comparisons(self): - # step 1: outer merge for rail operators (ignore route) # step 2: left merge for non-rail operators boards_df = self.compare_transit_boardings() @@ -498,7 +492,6 @@ def _make_transit_network_comparisons(self): return def _make_other_comparisons(self): - a_df = self._make_home_work_flow_comparisons() b_gdf = self._make_zero_vehicle_household_comparisons() c_gdf = self._make_bart_station_to_station_comparisons() @@ -516,7 +509,6 @@ def _make_other_comparisons(self): def _fix_technology_labels( self, input_df: pd.DataFrame, column_name: str ) -> pd.DataFrame: - assert column_name in input_df.columns r_df = input_df.copy() @@ -543,7 +535,6 @@ def _fix_technology_labels( return r_df def _make_home_work_flow_comparisons(self): - adjust_observed = ( self.s.simulated_home_work_flows_df.simulated_flow.sum() / self.o.ctpp_2012_2016_df.observed_flow.sum() @@ -577,7 +568,6 @@ def _make_home_work_flow_comparisons(self): return df def _make_zero_vehicle_household_comparisons(self): - c_df = self.s.reduced_simulated_zero_vehicle_hhs_df # prepare the observed data @@ -617,7 +607,6 @@ def _make_zero_vehicle_household_comparisons(self): return gdf def _make_bart_station_to_station_comparisons(self): - s_df = self.s.simulated_station_to_station_df.copy() df = pd.merge( @@ -651,7 +640,6 @@ def _make_bart_station_to_station_comparisons(self): return r_gdf def _make_rail_access_comparisons(self): - PARK_AND_RIDE_OBSERVED_THRESHOLD = 500 s_df = self.s.simulated_transit_access_df.copy() @@ -754,7 +742,6 @@ def _make_rail_access_comparisons(self): return r_gdf def _make_transit_district_flow_comparisons(self): - s_df = self.s.simulated_transit_district_to_district_by_tech_df.copy() o_df = self.o.reduced_transit_district_flows_by_technology_df.copy() diff --git a/tm2py/acceptance/canonical.py b/tm2py/acceptance/canonical.py index 7484df05..74f4967d 100644 --- a/tm2py/acceptance/canonical.py +++ b/tm2py/acceptance/canonical.py @@ -6,7 +6,6 @@ class Canonical: - canonical_dict: dict canonical_file: str @@ -63,7 +62,6 @@ class Canonical: ] def _load_configs(self): - with open(self.canonical_file, "r", encoding="utf-8") as toml_file: self.canonical_dict = toml.load(toml_file) @@ -89,7 +87,6 @@ def __init__( return def _make_canonical_agency_names_dict(self): - file_root = self.canonical_dict["remote_io"]["crosswalk_folder_root"] in_file = self.canonical_dict["crosswalks"]["canonical_agency_names_file"] @@ -137,7 +134,6 @@ def _make_canonical_agency_names_dict(self): return def _make_canonical_station_names_dict(self): - file_root = self.canonical_dict["remote_io"]["crosswalk_folder_root"] in_file = self.canonical_dict["crosswalks"]["canonical_station_names_file"] @@ -149,7 +145,6 @@ def _make_canonical_station_names_dict(self): running_operator_dict = {} for operator in df["operator"].unique(): - o_df = df[df["operator"] == operator].copy() a_df = o_df[["canonical"]].copy() @@ -176,14 +171,12 @@ def _make_canonical_station_names_dict(self): return def _make_census_maz_crosswalk(self): - url_string = self.canonical_dict["crosswalks"]["block_group_to_maz_url"] self.census_2010_to_maz_crosswalk_df = pd.read_csv(url_string) return def _read_standard_to_emme_transit(self): - root_dir = self.canonical_dict["remote_io"]["crosswalk_folder_root"] in_file = self.canonical_dict["crosswalks"]["standard_to_emme_transit_file"] @@ -194,7 +187,6 @@ def _read_standard_to_emme_transit(self): return def _make_tm2_to_gtfs_mode_crosswalk(self): - file_root = self.canonical_dict["remote_io"]["crosswalk_folder_root"] in_file = self.canonical_dict["crosswalks"]["standard_to_tm2_modes_file"] @@ -215,7 +207,6 @@ def _make_tm2_to_gtfs_mode_crosswalk(self): return def _read_standard_transit_to_survey_crosswalk(self): - file_root = self.canonical_dict["remote_io"]["crosswalk_folder_root"] in_file = self.canonical_dict["crosswalks"]["crosswalk_standard_survey_file"] @@ -243,7 +234,6 @@ def _read_standard_transit_to_survey_crosswalk(self): def aggregate_line_names_across_time_of_day( self, input_df: pd.DataFrame, input_column_name: str ) -> pd.DataFrame: - df = input_df[input_column_name].str.split(pat="_", expand=True).copy() df["daily_line_name"] = df[0] + "_" + df[1] + "_" + df[2] return_df = pd.concat([input_df, df["daily_line_name"]], axis="columns") @@ -251,7 +241,6 @@ def aggregate_line_names_across_time_of_day( return return_df def _read_taz_to_district_crosswalk(self): - file_root = self.canonical_dict["remote_io"]["crosswalk_folder_root"] in_file = self.canonical_dict["crosswalks"]["taz_to_district_file"] diff --git a/tm2py/acceptance/observed.py b/tm2py/acceptance/observed.py index 50b9b99c..3ac37e98 100644 --- a/tm2py/acceptance/observed.py +++ b/tm2py/acceptance/observed.py @@ -10,7 +10,6 @@ class Observed: - c: Canonical observed_dict: dict @@ -143,7 +142,6 @@ class Observed: reduced_transit_district_flows_by_technology_df: pd.DataFrame def _load_configs(self): - with open(self.observed_file, "r", encoding="utf-8") as toml_file: self.observed_dict = toml.load(toml_file) @@ -165,7 +163,6 @@ def __init__( self._reduce_observed_rail_access_summaries() def _validate(self): - if self.reduced_transit_on_board_df.empty: self.reduce_on_board_survey() @@ -193,7 +190,6 @@ def _validate(self): return def _join_florida_thresholds(self, input_df: pd.DataFrame) -> pd.DataFrame: - df = self.florida_transit_guidelines_df.copy() df["high"] = df["boardings"].shift(-1) df["low"] = df["boardings"] @@ -231,7 +227,6 @@ def _join_florida_thresholds(self, input_df: pd.DataFrame) -> pd.DataFrame: return pd.concat([return_df, other_df], axis="rows", ignore_index=True) def _join_standard_route_id(self, input_df: pd.DataFrame) -> pd.DataFrame: - df = self.c.standard_transit_to_survey_df.copy() df["survey_agency"] = df["survey_agency"].map( @@ -352,7 +347,6 @@ def reduce_on_board_survey(self, read_file_from_disk=True): return def _reduce_census_zero_car_households(self): - file_root = self.observed_dict["remote_io"]["obs_folder_root"] in_file = self.observed_dict["census"]["vehicles_by_block_group_file"] @@ -378,7 +372,6 @@ def _reduce_census_zero_car_households(self): return def _reduce_observed_bart_boardings(self): - file_root = self.observed_dict["remote_io"]["obs_folder_root"] in_file = self.observed_dict["transit"]["bart_boardings_file"] @@ -407,7 +400,6 @@ def _reduce_observed_bart_boardings(self): return def _make_census_geo_crosswalk(self): - file_root = self.observed_dict["remote_io"]["obs_folder_root"] pickle_file = self.observed_dict["census"]["census_geographies_pickle"] tract_geojson_file = self.observed_dict["census"][ @@ -453,7 +445,6 @@ def _make_census_geo_crosswalk(self): def _make_tract_centroids( self, input_gdf: gpd.GeoDataFrame, out_file: str ) -> gpd.GeoDataFrame: - t_gdf = input_gdf.dissolve(by="TRACTCE10") c_gdf = t_gdf.to_crs(3857).centroid.to_crs(4326).reset_index() df = pd.DataFrame(t_gdf.reset_index())[["TRACTCE10", "COUNTYFP10", "STATEFP10"]] @@ -471,7 +462,6 @@ def _make_tract_centroids( return def _reduce_ctpp_2012_2016(self): - file_root = self.observed_dict["remote_io"]["obs_folder_root"] in_file = self.observed_dict["census"]["ctpp_2012_2016_file"] @@ -497,7 +487,6 @@ def _reduce_ctpp_2012_2016(self): return def _reduce_observed_rail_access_summaries(self): - root_dir = self.observed_dict["remote_io"]["obs_folder_root"] in_file = self.observed_dict["transit"]["reduced_access_summary_file"] @@ -517,7 +506,6 @@ def _reduce_observed_rail_access_summaries(self): return def _reduce_observed_rail_flow_summaries(self): - root_dir = self.observed_dict["remote_io"]["obs_folder_root"] in_file = self.observed_dict["transit"]["reduced_flow_summary_file"] @@ -528,7 +516,6 @@ def _reduce_observed_rail_flow_summaries(self): return def _make_district_to_district_transit_flows_by_technology(self): - o_df = self.reduced_transit_spatial_flow_df.copy() o_df = o_df[o_df["time_period"] == "am"].copy() @@ -565,7 +552,6 @@ def _make_district_to_district_transit_flows_by_technology(self): return def _join_tm2_node_ids(self, input_df: pd.DataFrame) -> pd.DataFrame: - df = input_df.copy() nodes_df = self.c.standard_to_emme_node_crosswalk_df.copy() @@ -592,7 +578,6 @@ def _join_tm2_node_ids(self, input_df: pd.DataFrame) -> pd.DataFrame: return df def _join_ohio_standards(self, input_df: pd.DataFrame) -> pd.DataFrame: - df = self.ohio_rmse_standards_df.copy() df["upper"] = ( @@ -651,7 +636,6 @@ def _join_ohio_standards(self, input_df: pd.DataFrame) -> pd.DataFrame: def _identify_key_arterials_and_bridges( self, input_df: pd.DataFrame ) -> pd.DataFrame: - df1 = self.key_arterials_df.copy() df2 = self.bridges_df.copy() df = pd.concat([df1, df2])[["name", "direction", "pems_station_id"]].rename( @@ -667,7 +651,6 @@ def _identify_key_arterials_and_bridges( return out_df def _reduce_truck_counts(self) -> pd.DataFrame: - file_root = self.observed_dict["remote_io"]["obs_folder_root"] in_file = self.observed_dict["roadway"]["pems_truck_count_file"] @@ -896,7 +879,6 @@ def _reduce_pems_counts(self, read_file_from_disk=True): return return_df def _reduce_caltrans_counts(self): - file_root = self.observed_dict["remote_io"]["obs_folder_root"] in_file = self.observed_dict["roadway"]["caltrans_count_file"] diff --git a/tm2py/acceptance/simulated.py b/tm2py/acceptance/simulated.py index 7b599982..ecd6d051 100644 --- a/tm2py/acceptance/simulated.py +++ b/tm2py/acceptance/simulated.py @@ -13,7 +13,6 @@ class Simulated: - c: Canonical scenario_dict: dict @@ -83,7 +82,6 @@ class Simulated: } def _load_configs(self, scenario: bool = True, model: bool = True): - if scenario: with open(self.scenario_file, "r", encoding="utf-8") as toml_file: self.scenario_dict = toml.load(toml_file) @@ -117,7 +115,6 @@ def __init__( model_file: str = None, on_board_assign_summary: bool = False, ) -> None: - self.c = canonical self.scenario_file = scenario_file self._load_configs(scenario=True, model=False) @@ -202,7 +199,6 @@ def _reduce_simulated_transit_by_segment(self): def _get_operator_name_from_line_name( self, input_df: pd.DataFrame, input_column_name: str, output_column_name: str ) -> pd.DataFrame: - df = input_df[input_column_name].str.split(pat="_", expand=True).copy() df[output_column_name] = df[1] return_df = pd.concat([input_df, df[output_column_name]], axis="columns") @@ -210,7 +206,6 @@ def _get_operator_name_from_line_name( return return_df def _reduce_simulated_transit_shapes(self): - file_prefix = "boardings_by_segment_" time_period = "am" # am only gdf = gpd.read_file( @@ -290,7 +285,6 @@ def _reduce_simulated_transit_shapes(self): return def _join_coordinates_to_stations(self, input_df, input_column_name): - station_list = input_df[input_column_name].unique().tolist() x_df = self.c.standard_to_emme_transit_nodes_df.copy() @@ -315,7 +309,6 @@ def _join_coordinates_to_stations(self, input_df, input_column_name): return return_df def _read_standard_node(self): - in_file = os.path.join("inputs", "trn", "standard", "v12_node.geojson") gdf = gpd.read_file(in_file, driver="GEOJSON") @@ -324,7 +317,6 @@ def _read_standard_node(self): return def _read_standard_transit_stops(self): - in_file = os.path.join("inputs", "trn", "standard", "v12_stops.txt") df = pd.read_csv(in_file) @@ -334,7 +326,6 @@ def _read_standard_transit_stops(self): return def _read_standard_transit_shapes(self): - in_file = os.path.join("inputs", "trn", "standard", "v12_shapes.txt") df = pd.read_csv(in_file) @@ -344,7 +335,6 @@ def _read_standard_transit_shapes(self): return def _read_standard_transit_routes(self): - in_file = os.path.join("inputs", "trn", "standard", "v12_routes.txt") df = pd.read_csv(in_file) @@ -354,7 +344,6 @@ def _read_standard_transit_routes(self): return def _reduce_simulated_home_work_flows(self): - # if self.simulated_maz_data_df.empty: # self._make_simulated_maz_data() @@ -398,7 +387,6 @@ def _reduce_simulated_home_work_flows(self): return def _make_simulated_maz_data(self): - in_file = os.path.join("inputs", "landuse", "maz_data.csv") df = pd.read_csv(in_file) @@ -420,7 +408,6 @@ def _make_simulated_maz_data(self): return def _reduce_simulated_rail_access_summaries(self): - if not self.transit_mode_dict: self._make_transit_mode_dict() @@ -429,7 +416,6 @@ def _reduce_simulated_rail_access_summaries(self): out_df = pd.DataFrame() for time_period in self.model_time_periods: - df = pd.read_csv( os.path.join("output_summaries", file_prefix + time_period + ".csv"), dtype={"stop_name": str, "mdesc": str}, @@ -577,7 +563,7 @@ def _reduce_simulated_station_to_station(self): } ) - for (operator, time_period, path) in itertools.product( + for operator, time_period, path in itertools.product( operator_list, self.model_time_periods, path_list ): input_file_name = os.path.join( @@ -627,7 +613,6 @@ def _reduce_simulated_station_to_station(self): return def _join_tm2_mode_codes(self, input_df): - df = self.c.gtfs_to_tm2_mode_codes_df.copy() i_df = input_df["line_name"].str.split(pat="_", expand=True).copy() i_df["tm2_operator"] = i_df[0] @@ -648,16 +633,12 @@ def _join_tm2_mode_codes(self, input_df): return return_df def _reduce_simulated_transit_boardings(self): - file_prefix = "boardings_by_line_" c_df = pd.DataFrame() for time_period in self.model_time_periods: - df = pd.read_csv( - os.path.join( - "output_summaries", file_prefix + time_period + ".csv" - ) + os.path.join("output_summaries", file_prefix + time_period + ".csv") ) df["time_period"] = time_period c_df = pd.concat([c_df, df], axis="rows", ignore_index=True) @@ -707,7 +688,6 @@ def _reduce_simulated_transit_boardings(self): return def _reduce_simulated_zero_vehicle_households(self): - in_file = os.path.join("ctramp_output", "householdData_1.csv") df = pd.read_csv(in_file) @@ -908,7 +888,6 @@ def _get_station_names_from_standard_network( return return_df def _make_transit_mode_dict(self): # check - transit_mode_dict = {} for lil_dict in self.model_dict["transit"]["modes"]: add_dict = {lil_dict["mode_id"]: lil_dict["name"]} @@ -943,7 +922,6 @@ def _make_transit_mode_dict(self): # check return def _make_transit_technology_in_vehicle_table_from_skims(self): - path_list = [ "WLK_TRN_WLK", "PNR_TRN_WLK", @@ -957,9 +935,7 @@ def _make_transit_technology_in_vehicle_table_from_skims(self): skim_dir = os.path.join("skim_matrices", "transit") running_df = None - for (path, time_period) in itertools.product( - path_list, self.model_time_periods - ): + for path, time_period in itertools.product(path_list, self.model_time_periods): filename = os.path.join( skim_dir, "trnskm{}_{}.omx".format(time_period.upper(), path) ) @@ -995,7 +971,6 @@ def _make_transit_technology_in_vehicle_table_from_skims(self): path_time_df["time_period"] = time_period for tech in tech_list: - matrix_name = TIME_PERIOD + "_" + path + "_IVT" + tech if matrix_name in omx_handle.listMatrices(): df = self._make_dataframe_from_omx( @@ -1026,7 +1001,6 @@ def _make_transit_technology_in_vehicle_table_from_skims(self): return def _read_transit_demand(self): - path_list = [ "WLK_TRN_WLK", "PNR_TRN_WLK", @@ -1088,7 +1062,6 @@ def _make_dataframe_from_omx(self, input_mtx: omx, core_name: str): return df def _make_district_to_district_transit_summaries(self): - taz_district_dict = self.c.taz_to_district_df.set_index("taz_tm2")[ "district_tm2" ].to_dict() @@ -1146,7 +1119,6 @@ def _reduce_simulated_traffic_flow(self): time_of_day_df = pd.DataFrame() for time_period in self.model_time_periods: - emme_scenario = self.network_shapefile_names_dict[time_period] gdf = gpd.read_file( os.path.join("output_summaries", emme_scenario, "emme_links.shp") @@ -1217,7 +1189,6 @@ def _reduce_simulated_traffic_flow(self): return def _reduce_simulated_roadway_assignment_outcomes(self): - # step 1: get the shape shape_period = "am" emme_scenario = self.network_shapefile_names_dict[shape_period] @@ -1239,7 +1210,6 @@ def _reduce_simulated_roadway_assignment_outcomes(self): # step 2: fetch the roadway volumes across_df = pd.DataFrame() for t in self.model_time_periods: - if t == shape_period: gdf = shape_gdf else: diff --git a/tm2py/components/demand/commercial.py b/tm2py/components/demand/commercial.py index 17856422..65af8fde 100644 --- a/tm2py/components/demand/commercial.py +++ b/tm2py/components/demand/commercial.py @@ -293,7 +293,6 @@ def _generate_trip_ends(self, landuse_df: pd.DataFrame) -> pd.DataFrame: # TODO Do this with multi-indexing rather than relying on column naming for _c, _pa in _class_pa: - _trip_type = _c.purpose _trk_class = _c.name @@ -915,7 +914,6 @@ def run(self, trkclass_tp_demand_dict): class_demands = defaultdict(dict) for _time_period, _tclass in _tclass_time_combos: - _split_demand = self._toll_choice.run( trkclass_tp_demand_dict[_tclass.name][_time_period], _tclass.name, diff --git a/tm2py/components/demand/internal_external.py b/tm2py/components/demand/internal_external.py index febc1e0c..927b633a 100644 --- a/tm2py/components/demand/internal_external.py +++ b/tm2py/components/demand/internal_external.py @@ -125,7 +125,6 @@ class ExternalDemand(Subcomponent): """ def __init__(self, controller, component): - super().__init__(controller, component) self.config = self.component.config.demand # Loaded lazily @@ -288,7 +287,6 @@ def run( class_demands = defaultdict(dict) for _time_period, _class in _time_class_combos: - if _time_period in period_demand.keys(): None elif _time_period.lower() in period_demand.keys(): diff --git a/tm2py/components/demand/prepare_demand.py b/tm2py/components/demand/prepare_demand.py index 217ad903..b6d8f66d 100644 --- a/tm2py/components/demand/prepare_demand.py +++ b/tm2py/components/demand/prepare_demand.py @@ -493,7 +493,6 @@ def create_zero_passenger_trips( # Highway modes: one matrix per suffix (income class) per time period per mode for suffix in suffixes: - highway_cache = {} if (time_period, suffix) in it_grp.groups.keys(): diff --git a/tm2py/components/network/create_tod_scenarios.py b/tm2py/components/network/create_tod_scenarios.py index 448eb5c6..e9777d14 100644 --- a/tm2py/components/network/create_tod_scenarios.py +++ b/tm2py/components/network/create_tod_scenarios.py @@ -481,19 +481,15 @@ def _create_transit_scenarios(self): # set headway fraction, transfer wait perception and transfer boarding penalty at specific nodes for line in network.transit_lines(): for seg in line.segments(): - seg.i_node["@hdw_fraction"] = headway_fraction[ - line.vehicle.mode.id - ] - seg.j_node["@hdw_fraction"] = headway_fraction[ - line.vehicle.mode.id - ] + seg.i_node["@hdw_fraction"] = headway_fraction[line.vehicle.mode.id] + seg.j_node["@hdw_fraction"] = headway_fraction[line.vehicle.mode.id] seg.i_node["@wait_pfactor"] = transfer_wait_perception_factor[ line.vehicle.mode.id ] seg.j_node["@wait_pfactor"] = transfer_wait_perception_factor[ line.vehicle.mode.id ] - + if line.vehicle.mode.id == "h": if ( seg.i_node["#node_id"] diff --git a/tm2py/components/network/skims.py b/tm2py/components/network/skims.py index 5a371460..143e9a32 100644 --- a/tm2py/components/network/skims.py +++ b/tm2py/components/network/skims.py @@ -104,7 +104,6 @@ def get_omx_skim_as_numpy( # TODO figure out how to get upper() and lower() into actual format string if omx_manager is None: - _filename = _config.output_skim_filename_tmpl.format( time_period=time_period.lower() ) diff --git a/tm2py/components/network/transit/transit_assign.py b/tm2py/components/network/transit/transit_assign.py index c9d92502..056e624e 100644 --- a/tm2py/components/network/transit/transit_assign.py +++ b/tm2py/components/network/transit/transit_assign.py @@ -636,7 +636,6 @@ def run(self): def run_transit_assign( self, time_period: str, use_ccr: bool, congested_transit_assignment: bool ): - if use_ccr: self._run_ccr_assign(time_period) elif congested_transit_assignment: @@ -1351,7 +1350,6 @@ def _add_ccr_vars_to_scenario(self, emme_scenario: "EmmeScenario") -> None: ) def _get_network_with_ccr_scenario_attributes(self, emme_scenario): - self._add_ccr_vars_to_scenario(emme_scenario) _attributes = { @@ -2216,17 +2214,19 @@ def _journey_levels(self) -> EmmeTransitJourneyLevelSpec: jls = new_journey_levels[i] jls["transition_rules"].extend( [ - {"mode": "e", "next_journey_level": i+1}, - {"mode": "w", "next_journey_level": i+1}, + {"mode": "e", "next_journey_level": i + 1}, + {"mode": "w", "next_journey_level": i + 1}, { "mode": "a", - "next_journey_level": i+1, + "next_journey_level": i + 1, }, ] ) # level 0: only allow walk access and walk auxilary - # must use the trasit modes to get onto the next level, - transition_rules_walk = copy.deepcopy(journey_levels[0]["transition_rules"]) + # must use the trasit modes to get onto the next level, + transition_rules_walk = copy.deepcopy( + journey_levels[0]["transition_rules"] + ) transition_rules_walk.extend( [ { diff --git a/tm2py/components/time_of_day.py b/tm2py/components/time_of_day.py index 806d5a09..05f2f5df 100644 --- a/tm2py/components/time_of_day.py +++ b/tm2py/components/time_of_day.py @@ -20,7 +20,6 @@ def __init__( component: Component, split_configs: Collection[TimeSplitConfig], ): - super().__init__(controller, component) self.split_configs = split_configs diff --git a/tm2py/controller.py b/tm2py/controller.py index c7d52faf..8c0a21b6 100644 --- a/tm2py/controller.py +++ b/tm2py/controller.py @@ -292,7 +292,6 @@ def _queue_components(self, run_components: Collection[str] = None): # If start_component specified, remove things before its first occurance if self.config.run.start_component: - _queued_c_names = [c.name for c in self._queued_components] if self.config.run.start_component not in _queued_c_names: raise ValueError( diff --git a/tm2py/matrix.py b/tm2py/matrix.py index 279ca58a..d2b9710c 100644 --- a/tm2py/matrix.py +++ b/tm2py/matrix.py @@ -16,7 +16,6 @@ def create_matrix_factors( default_matrix: NumpyArray, periods: Optional[float] = None, ) -> NumpyArray: - adj_matrix = default_matrix for adj in matrix_factors: if adj.factor is not None: