UDST / spandex

Spatial Analysis and Data Extraction
http://nbviewer.ipython.org/github/synthicity/user_meeting_2014/blob/gh-pages/spandex/spandex_demo.ipynb
BSD 3-Clause "New" or "Revised" License
22 stars 7 forks source link

Create a lightweight injectables registry so that urbansim is not a dependency #2

Closed janowicz closed 10 years ago

janowicz commented 10 years ago

Code currently uses sim.add_injectable / sim.get_injectable to register database conn/cur objects so that conn/cur don't need to be passed around as function parameters.

jiffyclub commented 10 years ago

I don't think injectables are the right solution here, but I know what you mean.

I think the absolute best solution is something like SQLAlchemy's connection pooling. But if we don't want to depend on sqlalchemy we can try to sort out our own solution.

janowicz commented 10 years ago

Sounds good. When you get the chance, it'd be great if you could help us tweak things in the absence of using SQLAlchemy. Right now, the only place we use get_injectable('conn'/'cur') is in the exec_sql and db_to_df functions to get a global connection. Was using get_injectable like how in UrbanSim we register things in assumptions.py.