Skip to content

Commit 4c7fdf8

Browse files
committed
mp resume_after working with messy code
1 parent 218735d commit 4c7fdf8

34 files changed

+4382
-153
lines changed

activitysim/abm/models/accessibility.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __init__(self, skim_dict, orig_zones, dest_zones, transpose=False):
5757
# data = data[orig_map, :][:, dest_map] # <- RIGHT
5858
# data = data[np.ix_(orig_map, dest_map)] # <- ALSO RIGHT
5959

60-
skim_index = range(omx_shape.shape[0])
60+
skim_index = range(omx_shape[0])
6161
orig_map = np.isin(skim_index, skim_dict.offset_mapper.map(orig_zones))
6262
dest_map = np.isin(skim_index, skim_dict.offset_mapper.map(dest_zones))
6363

activitysim/abm/models/cdap.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# ActivitySim
22
# See full license in LICENSE.txt.
33

4+
from __future__ import print_function
45
import logging
5-
import os
66

77
import pandas as pd
88

@@ -107,7 +107,8 @@ def cdap_simulate(persons_merged, persons, households,
107107
pipeline.replace_table("households", households)
108108

109109
tracing.print_summary('cdap_activity', persons.cdap_activity, value_counts=True)
110-
print pd.crosstab(persons.ptype, persons.cdap_activity, margins=True)
110+
logger.info("cdap crosstabs:\n%s" %
111+
pd.crosstab(persons.ptype, persons.cdap_activity, margins=True))
111112

112113
if trace_hh_id:
113114

activitysim/abm/models/initialize.py

+2
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,5 @@ def preload_injectables():
107107

108108
if inject.get_injectable('skim_stack', None) is not None:
109109
t0 = tracing.print_elapsed_time("preload skim_stack", t0, debug=True)
110+
111+
return True

activitysim/abm/test/output/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
*.log
33
*.h5
44
*.txt
5+
*.yaml

activitysim/core/config.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def handle_standard_args(parser=None):
9494
parser.add_argument("-c", "--config", help="path to config dir", action='append')
9595
parser.add_argument("-o", "--output", help="path to output dir")
9696
parser.add_argument("-d", "--data", help="path to data dir")
97-
parser.add_argument("-r", "--resume", help="resume after")
97+
parser.add_argument("-r", "--resume", nargs='?', const='_', type=str, help="resume after")
9898
parser.add_argument("-m", "--multiprocess", type=str2bool, nargs='?', const=True,
9999
help="run multiprocess (boolean flag, no arg defaults to true)")
100100

@@ -133,9 +133,8 @@ def setting(key, default=None):
133133
s = inject.get_injectable(key, None)
134134

135135
if s:
136-
# fixme - when does this happen?
136+
# this happens when handle_standard_args overrides a setting with an injectable
137137
logger.info("read setting %s from injectable" % key)
138-
bug
139138

140139
# otherwise fall back to supplied default
141140
if s is None:

activitysim/core/inject.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22

33
import pandas as pd
4-
import orca
4+
from . import orca
55

66
_DECORATED_STEPS = {}
77
_DECORATED_TABLES = {}

activitysim/core/orca/__init__.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Orca
2+
# Copyright (C) 2016 UrbanSim Inc.
3+
# See full license in LICENSE.
4+
5+
from .orca import *
6+
7+
version = __version__ = '1.5.1'

0 commit comments

Comments
 (0)