Skip to content

Commit

Permalink
disagg acc doesn't crash but different results
Browse files Browse the repository at this point in the history
  • Loading branch information
jpn-- committed Nov 11, 2023
1 parent 7bce5f2 commit 16189f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions activitysim/abm/models/disaggregate_accessibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ class DisaggregateAccessibilityAnnotateSettings(PydanticReadable, extra="forbid"


class DisaggregateAccessibilitySettings(PydanticReadable, extra="forbid"):
suffixes: DisaggregateAccessibilitySuffixes = {"SUFFIX": None, "ROOTS": []}
suffixes: DisaggregateAccessibilitySuffixes = DisaggregateAccessibilitySuffixes()
ORIGIN_SAMPLE_SIZE: int | float = 0
DESTINATION_SAMPLE_SIZE: int | float = 0
BASE_RANDOM_SEED: int = 0
add_size_tables: bool = True
zone_id_names: dict[str, str] = {}
zone_id_names: dict[str, str] = {"index_col": "zone_id"}
ORIGIN_SAMPLE_METHOD: Literal[
None, "full", "uniform", "uniform-taz", "kmeans"
] = None
Expand Down Expand Up @@ -589,7 +589,7 @@ def annotate_tables(self, state: workflow.State):
df=df,
model_settings={
**annot.annotate.dict(),
**self.model_settings.suffixes,
**self.model_settings.suffixes.dict(),
},
trace_label=tracing.extend_trace_label("ProtoPop.annotate", tablename),
)
Expand Down
5 changes: 5 additions & 0 deletions activitysim/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import pyarrow.csv as csv
import pyarrow.parquet as pq
import yaml
from pydantic import BaseModel

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -466,6 +467,10 @@ def parse_suffix_args(args):


def concat_suffix_dict(args):
if isinstance(args, BaseModel):
args = args.dict()
if "source_file_paths" in args:
del args["source_file_paths"]
if isinstance(args, dict):
args = sum([["--" + k, v] for k, v in args.items()], [])
if isinstance(args, list):
Expand Down

0 comments on commit 16189f1

Please sign in to comment.