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

Porting to Python 3 #3

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

Porting to Python 3 #3

wants to merge 21 commits into from

Conversation

alephcero
Copy link

Main changes for Python 3

  • Because of formulas evaluation on text columns like pda_id > 0 when pda_id was a text, the columns was change using notnull() method on that column.
  • print() statements
  • Change zip() to list(zip()) as zip behavior changes
  • Change iteritems() method for items() in dict types
  • Encoding latin1 because of utf8 errors in building names in development_projects.csv
  • Replacing StringIO to io`
  • Add sys.path.append('baus') in models.py as module baus was not loading
  • Adding reduce import from functools import reduce because import error was happening in this line

In urbansim_defaults :

  • Change iteritems() method for items() in dict types
  • Change sorting to sort_values(by=)

Installation and use

  • conda create --name mtc-env3 python=3 numpy scipy==1.2 pandas geopandas scikit-learn
  • conda activate mtc-env3
  • git clone https://github.com/urbansim/bayarea_urbansim.git
  • git checkout python3
  • Copy large data files to data/
  • conda config --add channels udst
  • conda config --add channels conda-forge
  • conda install pandana=0.3 --channel udst
  • pip install -r requirements.txt
  • Preprocess data before simulate: python baus.py -c --mode preprocessing
  • python baus.py -c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants