- item 1
- item 2
Kepler visualization map: link
# Orca_test | |
# Copyright (c) 2016 UrbanSim Inc. | |
# See full license in LICENSE | |
""" | |
This is an informal set of tests for the various assertions. | |
""" | |
from __future__ import print_function |
Kepler visualization map: link
parcel_id | development_type_id | land_value | acres | county_id | zone_id | proportion_undevelopable | tax_exempt_status | apn | parcel_id_local | geom_id | imputation_flag | x | y | shape_area | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2054503 | -1 | 0.0 | 0.0 | 0 | 353 | 0.0 | 0 | 2054503 | synthetic, add_synth_nonres_bldg, nr_zone_yrblt, nr_region_yrblt, bsqft_from_nrsqft, stories1 | 0.0 | |||||
2054504 | -1 | 0.0 | 0.0 | 0 | 1439 | 0.0 | 0 | 2054504 | synthetic, add_synth_nonres_bldg, nr_zone_yrblt, nr_region_yrblt, bsqft_from_nrsqft, stories1 | 0.0 | |||||
2054505 | -1 | 0.0 | 0.0 | 0 | 353 | 0.0 | 0 | 2054505 | synthetic, add_synth_res_bldg, res_zone_yrblt, stories1 | 0.0 | |||||
2054506 | -1 | 0.0 | 0.0 | 0 | 1439 | 0.0 | 0 | 2054506 | synthetic | 0.0 |
Traceback (most recent call last): | |
File "baus.py", line 394, in <module> | |
run_models(MODE, SCENARIO) | |
File "baus.py", line 314, in run_models | |
], iter_vars=[IN_YEAR]) | |
File "/Users/maurer/opt/anaconda3/envs/mtc-env-27/lib/python2.7/site-packages/orca/orca.py", line 1992, in run | |
step() | |
File "/Users/maurer/opt/anaconda3/envs/mtc-env-27/lib/python2.7/site-packages/orca/orca.py", line 797, in __call__ | |
return self._func(**kwargs) | |
File "/Users/maurer/Dropbox/Git-mbp-new/bayareametro/bayarea_urbansim/baus/summaries.py", line 1148, in travel_model_output |
Traceback (most recent call last): | |
File "baus.py", line 392, in <module> | |
run_models(MODE, SCENARIO) | |
File "baus.py", line 314, in run_models | |
], iter_vars=[IN_YEAR]) | |
File "/Users/maurer/Dropbox/Git-mbp-new/bayareametro/bayarea_urbansim/src/orca/orca/orca.py", line 1945, in run | |
step() | |
File "/Users/maurer/Dropbox/Git-mbp-new/bayareametro/bayarea_urbansim/src/orca/orca/orca.py", line 791, in __call__ | |
return self._func(**kwargs) | |
File "/Users/maurer/Dropbox/Git-mbp-new/urbansim/bayarea_urbansim/baus/models.py", line 996, in neighborhood_vars |
Notes on migrating packages from Python 2.7 to Python 2/3 cross-compatibility
General resources
six
is a very helpful library for cross-version imports of things like urllib
Dependencies
# It can be helpful to set up a dedicated Python environment for each project you work on. This lets you use a stable and | |
# replicable set of libraries that won't be affected by other projects. | |
# OPTION 1: Production releases of UrbanSim Templates and ChoiceModels | |
# - includes all requirements plus some other useful packages | |
conda create --name template-env --channel udst --channel conda-forge python=3.6 scipy numpy pandas statsmodels patsy \ | |
urbansim orca choicemodels urbansim_templates pylogit scikit-learn jupyter nb_conda_kernels matplotlib geopandas pandana |
import orca | |
import pandas as pd | |
from urbansim_templates import modelmanager as mm # Orca extension for managing template steps | |
from urbansim_templates.models import BinaryLogitStep | |
mm.initialize() # load any saved steps from the local project directory | |
df = pd.read_csv('households.csv') | |
orca.add_table('households', df) |