Skip to content

Commit

Permalink
drop unrelated changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jpn-- committed Feb 2, 2024
1 parent f0a55c1 commit 3c047e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 55 deletions.
8 changes: 0 additions & 8 deletions activitysim/abm/models/cdap.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,7 @@ class CdapSettings(PydanticReadable, extra="forbid"):
INTERACTION_COEFFICIENTS: str = "cdap_interaction_coefficients.csv"
FIXED_RELATIVE_PROPORTIONS_SPEC: str = "cdap_fixed_relative_proportions.csv"
ADD_JOINT_TOUR_UTILITY: bool = False
"""
If True, add joint tour utility to CDAP model.
"""

JOINT_TOUR_COEFFICIENTS: str = "cdap_joint_tour_coefficients.csv"
"""
If ADD_JOINT_TOUR_UTILITY is True, this is the name of the coefficients file
for the joint tour utility spec.
"""
annotate_persons: PreprocessorSettings | None = None
annotate_households: PreprocessorSettings | None = None
COEFFICIENTS: Path
Expand Down
52 changes: 5 additions & 47 deletions activitysim/abm/models/disaggregate_accessibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@

class DisaggregateAccessibilitySuffixes(PydanticReadable):
SUFFIX: str = "proto_"
"""
Suffix to append to the proto-population tables.
"""

ROOTS: list[str] = [
"persons",
"households",
Expand All @@ -37,9 +33,6 @@ class DisaggregateAccessibilitySuffixes(PydanticReadable):
"household_id",
"tour_id",
]
"""
The roots of the proto-population tables.
"""


class DisaggregateAccessibilityTableSettings(PydanticReadable, extra="forbid"):
Expand Down Expand Up @@ -498,7 +491,7 @@ def read_table_settings(self):

return params

def generate_replicates(self, table_name: str):
def generate_replicates(self, table_name):
"""
Generates replicates finding the cartesian product of the non-mapped field variables.
The mapped fields are then annotated after replication
Expand Down Expand Up @@ -595,10 +588,7 @@ def expand_template_zones(self, tables):

return [x for x in proto_tables.values()]

def create_proto_pop(self) -> None:
"""
Creates the proto-population tables.
"""
def create_proto_pop(self):
# Separate out the mapped data from the varying data and create base replicate tables
klist = ["proto_households", "proto_persons", "proto_tours"]

Expand Down Expand Up @@ -668,14 +658,7 @@ def create_proto_pop(self) -> None:
if len(colnames) > 0:
df.rename(columns=colnames, inplace=True)

def inject_tables(self, state: workflow.State) -> None:
"""
Injects the proto-population tables into the pipeline.
Parameters
----------
state : workflow.State
"""
def inject_tables(self, state: workflow.State):
# Update canonical tables lists
state.tracing.traceable_tables = state.tracing.traceable_tables + list(
self.proto_pop.keys()
Expand All @@ -685,14 +668,7 @@ def inject_tables(self, state: workflow.State) -> None:
self.state.get_rn_generator().add_channel(tablename, df)
state.tracing.register_traceable_table(tablename, df)

def annotate_tables(self, state: workflow.State) -> None:
"""
Annotates the proto-population tables with additional fields.
Parameters
----------
state : workflow.State
"""
def annotate_tables(self, state: workflow.State):
# Extract annotations
for annot in self.model_settings.annotate_proto_tables:
tablename = annot.tablename
Expand All @@ -710,10 +686,7 @@ def annotate_tables(self, state: workflow.State) -> None:
)
self.state.add_table(tablename, df)

def merge_persons(self) -> None:
"""
Merges the proto-population households into the persons.
"""
def merge_persons(self):
persons = self.state.get_dataframe("proto_persons")
households = self.state.get_dataframe("proto_households")

Expand All @@ -740,21 +713,6 @@ def merge_persons(self) -> None:
def get_disaggregate_logsums(
state: workflow.State, network_los: los.Network_LOS, chunk_size: int, trace_hh_id
):
"""
Get disaggregate logsums for workplace, school, and non-mandatory tour destinations.
Parameters
----------
state : workflow.State
network_los : los.Network_LOS
chunk_size : int
trace_hh_id : int, optional
Returns
-------
logsums : dict
Dictionary of logsums for each of the three destination types.
"""
logsums = {}
persons_merged = state.get_dataframe("proto_persons_merged").sort_index(
inplace=False
Expand Down

0 comments on commit 3c047e0

Please sign in to comment.