Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phase 4 work #259

Merged
merged 129 commits into from Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
4e7d91d
future warnings fixes
toliwaga Aug 1, 2018
2a5ea23
replace deprecated pandas as_matrix calls)
toliwaga Aug 2, 2018
d75ba4f
fix rows_per_chunk to avoid rounding above chunk_size
toliwaga Aug 14, 2018
22d7bea
tracing builds rather than imports traceable_table_refs
toliwaga Sep 4, 2018
97d1cde
atwork subtour scheduling expression files and model support
toliwaga Sep 5, 2018
b43bf16
AccessibilitySkims slices skims to handle partial orig/dest zone cove…
toliwaga Sep 6, 2018
8cbbc8a
skim usage tracing
toliwaga Sep 11, 2018
1c72c48
throwaway targets recognized by assign.assign_variables
toliwaga Sep 12, 2018
ce2a4b5
add axis argument to pipeline.extend_table
toliwaga Sep 17, 2018
0bfd858
accept output_dir arg to tracing.delete_csv_files for 0.7 compatibility
toliwaga Sep 17, 2018
ece63a6
call read_model_spec from model code instead of injectable
toliwaga Sep 20, 2018
e7996ad
more options for read_model_spec
toliwaga Sep 20, 2018
77ac906
example_mp multiprocessing prototype works on mac - no tests or docum…
toliwaga Sep 29, 2018
82093a2
eval_variables coerce result columns to numeric to avoid memory inten…
toliwaga Oct 2, 2018
1ee96ee
mp chunk_size in step_info
toliwaga Oct 2, 2018
129cfb3
remove needless df astype in utils_to_probs
toliwaga Oct 2, 2018
91fb4f5
mp pass injectables to sub procs
toliwaga Oct 3, 2018
cb7e01e
suppress_intermediate_checkpoints for mp
toliwaga Oct 3, 2018
218735d
segment skim_data into blocks based on MAX_BLOCK_BYTES
toliwaga Oct 5, 2018
4c7fdf8
mp resume_after working with messy code
toliwaga Oct 11, 2018
ee77f55
passing tests
toliwaga Oct 13, 2018
b1eb103
pycodestyle
toliwaga Oct 13, 2018
2d6fc31
futurize stage2
toliwaga Oct 14, 2018
5c769a0
p3.5
toliwaga Oct 16, 2018
2a75ed7
mp_tasks and p3.5 tests
toliwaga Oct 16, 2018
4b6f859
reorg mp_tasks for profiling
toliwaga Oct 17, 2018
e159840
mp_tasks profiling hooks
toliwaga Oct 18, 2018
06ef4f2
smrter mp resume with completed list
toliwaga Oct 19, 2018
eebd319
minor testing tweaks
toliwaga Oct 22, 2018
c70dc91
no unicode for python 2.7
toliwaga Oct 22, 2018
4749f28
add memory info to log_chunk_size
toliwaga Oct 23, 2018
e2e9fdd
core.mem and core.chunl.log
toliwaga Oct 24, 2018
26db144
log_df also taketh away for del
toliwaga Oct 25, 2018
f8eb419
filter mandatory_tour_scheduling choosers, narrow tdd_alts
toliwaga Oct 25, 2018
3cabce1
timetable tdd_footprints as np array using smart indexing isntead of loc
toliwaga Oct 26, 2018
32f1815
settings cleanup
toliwaga Oct 26, 2018
a63fd13
performance enhancements in simulate.eval_utilities and SkimWrapper.get
toliwaga Oct 31, 2018
2800965
trace_memory_info
toliwaga Oct 31, 2018
0a9f5de
trace_memory_info sums rss of children
toliwaga Nov 1, 2018
86569c7
trace_memory_info sums rss of children
toliwaga Nov 1, 2018
65f69c6
pycodestype bare except becomes except psutil.NoSuchProcess
toliwaga Nov 1, 2018
dcb90ce
log_df log mem
toliwaga Nov 1, 2018
4563a23
better chunk logging
toliwaga Nov 2, 2018
1c0abab
effective_chunk_size in chunk logging
toliwaga Nov 3, 2018
5c0e3d9
output_dir log subdir
toliwaga Nov 6, 2018
4dd3388
coalesce and slice
toliwaga Nov 14, 2018
ba66a1b
example_2mp
toliwaga Nov 14, 2018
e983644
handle_standard_args returns overrridden injectables
toliwaga Nov 15, 2018
0938f7b
example_2mp with stride script
toliwaga Nov 26, 2018
0a846a0
add example_azure
toliwaga Nov 27, 2018
9f51507
consolidate work and school location sub-models
toliwaga Nov 28, 2018
f4609ee
ShadowPriceCalculator with share data sycnhronization
toliwaga Dec 6, 2018
7d10764
shadow pricing in workplace_location
toliwaga Dec 7, 2018
a0c186e
shadow_pricing implemented but not converging for partial datasets
toliwaga Dec 10, 2018
c101aed
azure windows recipes
toliwaga Dec 12, 2018
df1897e
Merge branch 'dev' into shadow
toliwaga Dec 12, 2018
31b1e64
global use_shadow_pricing setting
toliwaga Dec 13, 2018
a3d6335
mp_tasks fail_fast settign and better exception logging
toliwaga Dec 13, 2018
b4c8f75
bug in handle_standard_args where data_dir not getting set
toliwaga Dec 13, 2018
56a5f4a
stale variable reference
toliwaga Dec 14, 2018
5c59dbc
trace shadow_prices
toliwaga Dec 17, 2018
91f2923
bug in shadow_pricing max)fail calculation
toliwaga Dec 17, 2018
301958c
consolidate school and workplace location model logic and add shadow_…
toliwaga Dec 20, 2018
1d031d6
individual value of time
toliwaga Dec 26, 2018
b1e7a72
off by one iteration number in location_choice
toliwaga Dec 28, 2018
a7aa305
ShadowPriceCalculator docstrings
toliwaga Jan 4, 2019
d1d3697
pycodestyle
toliwaga Jan 4, 2019
cd972e1
location_choice docstrings and rename selector model_selector to avoi…
toliwaga Jan 7, 2019
e370f28
documentation and cleanup of mp_tasks
toliwaga Jan 10, 2019
fa8da76
docstrings for skim OffsetMapper
toliwaga Jan 11, 2019
61b8d97
consolidate joint tour destination
toliwaga Jan 11, 2019
9ae088c
consolidate atwork_subtour_destination
toliwaga Jan 11, 2019
908f682
add scripts to create inputs from the latest TM1 CT-RAMP example setu…
bstabler Jan 24, 2019
b892159
passing tests with mtc_tm1 verification dataset
toliwaga Feb 1, 2019
7b45e48
pycodestyle
toliwaga Feb 1, 2019
c8b1f9f
rebuild mtca-asim.h5 with python3 for pytables compatability
toliwaga Feb 1, 2019
e5e9098
improved tracing of eval_utilities in simulate.py
toliwaga Feb 15, 2019
8be0a1c
verification dir
toliwaga Feb 15, 2019
450cdcc
verification bus fixes
toliwaga Feb 27, 2019
aef6e01
five skim_time_periods not three
toliwaga Feb 28, 2019
7bd8dea
clean up id tracing
toliwaga Feb 28, 2019
49e7a6f
tour scheduling logsums
toliwaga Mar 4, 2019
5ff2aba
nonredundant tdd logsums
toliwaga Mar 4, 2019
0122456
transit skims in Cube (and therefore OMX export) are scaled ints so n…
bstabler Mar 4, 2019
9a45f55
numpy==1.15.4 until pytables issue 719 fixed in tables 3.5.0
toliwaga Mar 4, 2019
b27dfa0
Merge branch 'verification' of https://github.com/ActivitySim/activit…
toliwaga Mar 4, 2019
9cd536f
scale ivt in annotate_persons_workplace.csv
toliwaga Mar 4, 2019
fbca4e0
python 3.5 is dead, long live python 3.6
toliwaga Mar 5, 2019
2a334d9
daysim shadow pricing adjustment exposed to expressions
toliwaga Mar 6, 2019
c35e635
pycodestyle
toliwaga Mar 6, 2019
28f4398
expose shadow_price_size_term_adjustment
toliwaga Mar 6, 2019
c02f510
bug in primary_purpose assignment in mandatory_scheduling
toliwaga Mar 7, 2019
1c5412f
fix initial shadow price for daysim version
toliwaga Mar 7, 2019
6f3ec27
1 - add 100% sample ctramp and daysim sp verification tests, 2 - fix …
bstabler Mar 11, 2019
863a27b
non_mandatory logsums working
toliwaga Mar 12, 2019
745053e
avoid daysim sp 0 modeled size yoyo
toliwaga Mar 12, 2019
464e1c5
back to python 3.6
toliwaga Mar 12, 2019
05d9a89
atwork subtour frequency expressions
toliwaga Mar 13, 2019
258010e
sort tour destination choosers before dest sample generation
toliwaga Mar 13, 2019
3825a31
lint
toliwaga Mar 13, 2019
c5c5186
kids 0 to 5 should not got to school
bstabler Mar 18, 2019
cc33048
remove some commented out lines since no longer needed
bstabler Mar 20, 2019
d209bbd
fix getting started example call
bstabler Mar 23, 2019
174d6a1
bug in num_non_mand calc
toliwaga Apr 3, 2019
9c644fc
expression file fixes
bstabler Apr 4, 2019
1c2c746
free parking
toliwaga Apr 4, 2019
439f7d7
merge
toliwaga Apr 4, 2019
c7a2e33
fix confusion about in and out semantics
toliwaga Apr 4, 2019
8df86ba
passing tests
toliwaga Apr 4, 2019
9f81628
pycodestyle
toliwaga Apr 4, 2019
99a41fd
ensure pyyaml version works #253
bstabler Apr 4, 2019
7455624
Merge branch 'verification-fixes' of https://github.com/ActivitySim/a…
bstabler Apr 4, 2019
57e697d
yaml.load argument Loader now required
toliwaga Apr 4, 2019
7c50794
Merge pull request #254 from ActivitySim/verification-fixes
bstabler Apr 5, 2019
119672c
add missing NMTF filter expressions and use updated TM1 VOT settings
bstabler Apr 8, 2019
4224795
use same auto operating costs as the TM1 verification example
bstabler Apr 8, 2019
56a22af
fix tsf work expression
bstabler Apr 10, 2019
73965da
#249
bstabler Apr 11, 2019
21a1936
user documentation updates
bstabler Apr 18, 2019
023525c
pycodestyle
bstabler Apr 18, 2019
c3b5133
doc updates for Python 3 as the default
bstabler Apr 19, 2019
7aa1b4c
better shadow_pricing logging
toliwaga Apr 22, 2019
2556d0a
merge
toliwaga Apr 22, 2019
c4f4bf7
hopefully passing tests
toliwaga Apr 22, 2019
63b612d
fix numpy package dependency
bstabler Apr 22, 2019
e97148b
corrected the tm1 age 0,1 expression
bstabler Apr 23, 2019
103fdd5
cdap choose backfill persons randomly like ctramp
toliwaga Apr 23, 2019
80ff4a0
non_mandatory_tour_frequency_extension
toliwaga Apr 24, 2019
72e6861
add verification summaries script, update docs for nmtf extension sub…
bstabler Apr 26, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,10 +1,10 @@
sandbox/
sandbox.py
example/data/*
.idea
.ipynb_checkpoints
.coverage*
.pytest_cache
.vagrant


# Byte-compiled / optimized / DLL files
Expand Down
16 changes: 16 additions & 0 deletions .pylintrc
@@ -0,0 +1,16 @@
[MESSAGES CONTROL]
disable=locally-disabled,
# False positive for type annotations with typing module
# invalid-sequence-index,
# False positive for OK test methods names and few other places
invalid-name,
# False positive for test file classes and methods
missing-docstring

[REPORTS]
# Simplify pylint reports
reports=no

[SIMILARITIES]
min-similarity-lines=10
ignore-docstrings=yes
17 changes: 9 additions & 8 deletions .travis.yml
@@ -1,23 +1,24 @@
language: python
sudo: false
python:
- '2.7'
- '2.7'
- '3.6'
install:
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then wget http://repo.continuum.io/miniconda/Miniconda-3.7.0-Linux-x86_64.sh
-O miniconda.sh; else wget http://repo.continuum.io/miniconda/Miniconda3-3.7.0-Linux-x86_64.sh
-O miniconda.sh; fi
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]];
then wget http://repo.continuum.io/miniconda/Miniconda-3.7.0-Linux-x86_64.sh -O miniconda.sh;
else wget http://repo.continuum.io/miniconda/Miniconda3-3.7.0-Linux-x86_64.sh -O miniconda.sh; fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- |
conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION cytoolz numpy pandas pip pytables pyyaml toolz psutil
conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION cytoolz numpy pandas pip pytables pyyaml toolz psutil future
- source activate test-environment
- pip install orca openmatrix zbox
- pip install pytest pytest-cov coveralls pycodestyle
- pip install sphinx numpydoc sphinx_rtd_theme
- pip install openmatrix zbox
- conda install pytest pytest-cov coveralls pycodestyle
- conda install sphinx numpydoc sphinx_rtd_theme
- pip install .
- pip freeze
script:
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
@@ -1,2 +1,4 @@
include ez_setup.py
include README.rst
include activitysim\abm\test\data\mtc_asim.h5
include activitysim\abm\test\data\skims.omx
12 changes: 0 additions & 12 deletions README.rst

This file was deleted.

8 changes: 5 additions & 3 deletions activitysim/abm/__init__.py
@@ -1,6 +1,8 @@
# ActivitySim
# See full license in LICENSE.txt.

import misc
import tables
import models
from __future__ import absolute_import

from . import misc
from . import tables
from . import models
47 changes: 13 additions & 34 deletions activitysim/abm/misc.py
@@ -1,45 +1,24 @@
# ActivitySim
# See full license in LICENSE.txt.

import os
import warnings
from __future__ import (absolute_import, division, print_function, )
from future.standard_library import install_aliases
install_aliases() # noqa: E402

import logging

import numpy as np
import pandas as pd
import yaml

from activitysim.core import pipeline
from activitysim.core import config
from activitysim.core import inject

# FIXME
warnings.filterwarnings('ignore', category=pd.io.pytables.PerformanceWarning)
# warnings.filterwarnings('ignore', category=pd.io.pytables.PerformanceWarning)
pd.options.mode.chained_assignment = None

logger = logging.getLogger(__name__)


@inject.injectable(cache=True)
def store(data_dir, settings):
if 'store' not in settings:
logger.error("store file name not specified in settings")
raise RuntimeError("store file name not specified in settings")
fname = os.path.join(data_dir, settings["store"])
if not os.path.exists(fname):
logger.error("store file not found: %s" % fname)
raise RuntimeError("store file not found: %s" % fname)

file = pd.HDFStore(fname, mode='r')
pipeline.close_on_exit(file, fname)

return file


@inject.injectable(cache=True)
def cache_skim_key_values(settings):
return settings['skim_time_periods']['labels']


@inject.injectable(cache=True)
def households_sample_size(settings, override_hh_ids):

Expand All @@ -50,18 +29,18 @@ def households_sample_size(settings, override_hh_ids):


@inject.injectable(cache=True)
def override_hh_ids(settings, configs_dir):
def override_hh_ids(settings):

hh_ids_filename = settings.get('hh_ids', None)
if hh_ids_filename is None:
return None

f = os.path.join(configs_dir, hh_ids_filename)
if not os.path.exists(f):
logger.error('hh_ids file name specified in settings, but file not found: %s' % f)
file_path = config.data_file_path(hh_ids_filename, mandatory=False)
if not file_path:
logger.error("hh_ids file name '%s' specified in settings not found" % hh_ids_filename)
return None

df = pd.read_csv(f, comment='#')
df = pd.read_csv(file_path, comment='#')

if 'household_id' not in df.columns:
logger.error("No 'household_id' column in hh_ids file %s" % hh_ids_filename)
Expand All @@ -85,7 +64,7 @@ def trace_hh_id(settings):
id = settings.get('trace_hh_id', None)

if id and not isinstance(id, int):
logger.warn("setting trace_hh_id is wrong type, should be an int, but was %s" % type(id))
logger.warning("setting trace_hh_id is wrong type, should be an int, but was %s" % type(id))
id = None

return id
Expand All @@ -97,7 +76,7 @@ def trace_od(settings):
od = settings.get('trace_od', None)

if od and not (isinstance(od, list) and len(od) == 2 and all(isinstance(x, int) for x in od)):
logger.warn("setting trace_od is wrong type, should be a list of length 2, but was %s" % od)
logger.warning("setting trace_od should be a list of length 2, but was %s" % od)
od = None

return od
Expand Down
59 changes: 28 additions & 31 deletions activitysim/abm/models/__init__.py
@@ -1,35 +1,32 @@
# ActivitySim
# See full license in LICENSE.txt.

import initialize
import accessibility
import auto_ownership
import mandatory_tour_frequency
import mandatory_scheduling
import joint_tour_frequency
import joint_tour_composition
import joint_tour_participation
import joint_tour_destination
import joint_tour_scheduling
import non_mandatory_tour_frequency
import non_mandatory_destination
import non_mandatory_scheduling
import school_location
import workplace_location
import tour_mode_choice
import cdap
from __future__ import absolute_import

import atwork_subtour_frequency
import atwork_subtour_destination
import atwork_subtour_scheduling
import atwork_subtour_mode_choice

import stop_frequency
import trip_purpose
import trip_destination
import trip_purpose_and_destination
import trip_scheduling
import trip_mode_choice

# parameterized models
import annotate_table
from . import accessibility
from . import atwork_subtour_destination
from . import atwork_subtour_frequency
from . import atwork_subtour_mode_choice
from . import atwork_subtour_scheduling
from . import auto_ownership
from . import cdap
from . import free_parking
from . import initialize
from . import joint_tour_composition
from . import joint_tour_destination
from . import joint_tour_frequency
from . import joint_tour_participation
from . import joint_tour_scheduling
from . import location_choice
from . import mandatory_scheduling
from . import mandatory_tour_frequency
from . import non_mandatory_destination
from . import non_mandatory_scheduling
from . import non_mandatory_tour_frequency
from . import stop_frequency
from . import tour_mode_choice
from . import trip_destination
from . import trip_mode_choice
from . import trip_purpose
from . import trip_purpose_and_destination
from . import trip_scheduling