Skip to content

Commit

Permalink
Merge 74b1fcc into a57efa1
Browse files Browse the repository at this point in the history
  • Loading branch information
jpn-- committed Jul 9, 2021
2 parents a57efa1 + 74b1fcc commit c12998a
Show file tree
Hide file tree
Showing 14 changed files with 164 additions and 2,034 deletions.
27 changes: 15 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ env:
global:
# GH_TOKEN ActivitySim/activitysim public_repo token
- secure: WZeCAmI08hBRgtVWUlerfizvSpOVlBxQDa/Z6HJiDUlIXdSAOIi7TAwnluOgs3lHbSqACegbLCU9CyIQa/ytwmmuwzltkSQN14EcnKea0bXyygd8DFdx4x8st8M3a4nh2svgp4BDM9PCu6T1XIZ1rYM46JsKzNk9X8GpWOVN498=
- TEST_ENV=activitysim-test
jobs:
# Add new TEST_SUITE jobs as needed via Travis build matrix expansion
# define an alternative TEST_ENV to add special dependencies for particular tests
- TEST_SUITE=activitysim/abm/models
- TEST_SUITE=activitysim/abm/test
- TEST_SUITE=activitysim/cli
- TEST_SUITE=activitysim/core
- TEST_SUITE=activitysim/estimation/test/test_larch_estimation.py TEST_DEPENDS="larch>=5.5.3 -c conda-forge"
- TEST_SUITE=activitysim/estimation/test/test_larch_estimation.py TEST_ENV="activitysim-test-larch"
- TEST_SUITE=activitysim/examples/example_mtc/test
- TEST_SUITE=activitysim/examples/example_multiple_zone/test
- TEST_SUITE=activitysim/examples/example_marin/test
Expand All @@ -25,26 +27,27 @@ python:
- '3.8'

install:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- wget -O Mambaforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh
- bash Mambaforge.sh -b -p $HOME/miniconda
- source "$HOME/miniconda/etc/profile.d/conda.sh"
- 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
- conda activate test-environment
- conda install pytest pytest-cov coveralls pycodestyle $TEST_DEPENDS
- pip install pytest-regressions
- mamba update -q mamba
- mamba info -a
# write travis python version into selected test environment definition file
- sed -e "s/\${TRAVIS_PYTHON_VERSION}/${TRAVIS_PYTHON_VERSION}/" conda-environments/${TEST_ENV}.yml > conda-env.yml
# create test environment in one pass
- mamba env create -n asimtest --file conda-env.yml
- conda activate asimtest
- pip install .
- pip freeze

script:
# build 2 and 3 zone test data twice since the Python test code on Linux sees these as different locations
- python activitysim/examples/example_multiple_zone/scripts/two_zone_example_data.py
- python activitysim/examples/example_multiple_zone/scripts/three_zone_example_data.py
- python /home/travis/miniconda/envs/test-environment/lib/python$TRAVIS_PYTHON_VERSION/site-packages/activitysim/examples/example_multiple_zone/scripts/two_zone_example_data.py
- python /home/travis/miniconda/envs/test-environment/lib/python$TRAVIS_PYTHON_VERSION/site-packages/activitysim/examples/example_multiple_zone/scripts/three_zone_example_data.py
- python /home/travis/miniconda/envs/asimtest/lib/python$TRAVIS_PYTHON_VERSION/site-packages/activitysim/examples/example_multiple_zone/scripts/two_zone_example_data.py
- python /home/travis/miniconda/envs/asimtest/lib/python$TRAVIS_PYTHON_VERSION/site-packages/activitysim/examples/example_multiple_zone/scripts/three_zone_example_data.py
# pycodestyle
- pycodestyle activitysim
# run specific TEST_SUITE job on travis to avoid job max time
Expand All @@ -53,7 +56,7 @@ script:
after_success:
- coveralls
# Build docs
- pip install sphinx numpydoc sphinx_rtd_theme
- mamba install sphinx numpydoc sphinx_rtd_theme
- cd docs
- make clean
- make html
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/util/cdap.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import numpy as np
import pandas as pd
from zbox import toolz as tz, gen

from activitysim.core import simulate
from activitysim.core import pipeline
Expand Down
6 changes: 6 additions & 0 deletions activitysim/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,12 @@ def filter_warnings():
warnings.filterwarnings('ignore', category=DeprecationWarning, module='tables',
message='`np.object` is a deprecated alias')

# beginning pandas version 1.3, various places emit a PerformanceWarning that is
# caught in the "strict" filter above, but which are currently unavoidable for complex models.
# These warning are left as warnings as an invitation for future enhancement.
from pandas.errors import PerformanceWarning
warnings.filterwarnings('default', category=PerformanceWarning)


def handle_standard_args(parser=None):

Expand Down
21 changes: 7 additions & 14 deletions activitysim/core/inject.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@
# See full license in LICENSE.txt.
import logging

try:
# use orca module if installed
import orca
import orca.orca as _ORCA
except ModuleNotFoundError:
# otherwise use local copy
from . import orca
from . import orca as _ORCA
from orca import orca

_DECORATED_STEPS = {}
_DECORATED_TABLES = {}
Expand Down Expand Up @@ -135,7 +128,7 @@ def get_injectable(name, default=_NO_DEFAULT):

def remove_injectable(name):

_ORCA._INJECTABLES.pop(name, None)
orca._INJECTABLES.pop(name, None)


def reinject_decorated_tables():
Expand All @@ -146,10 +139,10 @@ def reinject_decorated_tables():
logger.info("reinject_decorated_tables")

# need to clear any non-decorated tables that were added during the previous run
_ORCA._TABLES.clear()
_ORCA._COLUMNS.clear()
_ORCA._TABLE_CACHE.clear()
_ORCA._COLUMN_CACHE.clear()
orca._TABLES.clear()
orca._COLUMNS.clear()
orca._TABLE_CACHE.clear()
orca._COLUMN_CACHE.clear()

for name, func in _DECORATED_TABLES.items():
logger.debug("reinject decorated table %s" % name)
Expand Down Expand Up @@ -189,4 +182,4 @@ def get_step_arg(arg_name, default=_NO_DEFAULT):
def dump_state():

print("_DECORATED_STEPS", list(_DECORATED_STEPS.keys()))
print("_ORCA._STEPS", list(_ORCA._STEPS.keys()))
print("orca._STEPS", list(orca._STEPS.keys()))
Loading

0 comments on commit c12998a

Please sign in to comment.