Skip to content

Instantly share code, notes, and snippets.

View smmaurer's full-sized avatar

Sam Maurer smmaurer

View GitHub Profile
# 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

Highest-level heading

Notes for a CP 255 project

  • item 1
  • item 2

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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smmaurer
smmaurer / gist:eaac20c8c11f087e1b868a7b12929231
Created February 14, 2020 21:44
travel_model_output error
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
@smmaurer
smmaurer / gist:d063900b62b374572f880bb53eefaaba
Created February 3, 2020 01:18
BAUS Pandana 0.4.4 error
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
@smmaurer
smmaurer / python-2-3.md
Created May 23, 2019 01:23
Python 3 migration
@smmaurer
smmaurer / create-environments.sh
Last active January 10, 2019 21:11
Create a Conda environment for an UrbanSim Templates project
# 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)
@smmaurer
smmaurer / 2018-07-chts-destination-choice.ipynb
Created July 23, 2018 22:19
Building a custom merged choice table
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.