Creating a Baseyear Cache

From: Lefteris Samartzis <left_at_citycable.ch>
Date: Mon, 4 Dec 2006 16:15:00 +0100

Dear UrbanSim users,

I am trying to create a baseyear cache from a MySql database in order to
launch a simulation for the first time. For now, I am just trying to run
a simulation using the same file and database structure as in the Eugene
tutorial, but with data from my new application city to keep things simple.

I have tried to create the baseyear cache using create_baseyear_cache in
the directory opus_core/tools, but I've run into some problems. As a
result, I wonder if I am doing something wrong and wonder if this is the
right way to create the database cache from a MySql database?

Here is a description of what I have done and the the problems I am having:

First, I exported the baseyear cache of the modified Eugene database to
MySql using export_cache_to_mysql.py in eugene/tools. I exported it in a
database called eugene.

Second, I changed the baseline.py configuration file in order to include
the link to the MySql database eugene.

Third, I used the command :

python create_baseyear_cache eugene.configs.baseline

At first, I received an error that the table 'scenario_information' was
missing. I created this table and added the requested field
'PARENT_DATABASE_URL' with the value 'jdbc:mysql://localhost/eugene'

When I tried to run create_baseyear_cache again, the following errors
were returned:

...
File
"C:\Python24\Lib\site-packages\opus_core\store\scenario_database.py",
line 94, in _create_table_mapping
     self._create_table_mapping(next_database_name)
File
"C:\Python24\Lib\site-packages\opus_core\store\scenario_database.py",
line 94, in _create_table_mapping
     self._create_table_mapping(next_database_name)
File
"C:\Python24\Lib\site-packages\opus_core\store\scenario_database.py",
line 94, in _create_table_mapping
     self._create_table_mapping(next_database_name)
File
"C:\Python24\Lib\site-packages\opus_core\store\scenario_database.py",
line 70, in _create_table_mapping
     cursor.execute(sql)
File "C:\Python24\Lib\site-packages\MySQLdb\cursors.py", line 163, in
execute
     self.errorhandler(self, exc, value)
File "C:\Python24\Lib\site-packages\MySQLdb\connections.py", line 35, in
defaulterrorhandler
     raise errorclass, errorvalue
RuntimeError: maximum recursion depth exceeded
>>> Exception _mysql_exceptions.ProgrammingError: (2014, "Commands out
of sync; you can't run this command now") in <bound method
Cursor.__del__ of <MySQLdb.cursors.Cursor object at 0x0278F850>> ignored

I use MySql 5.0 on Windows XP. Any help that anyone could provide would
be most appreciated.

Thanks and all the best,
Lefteris
Received on Mon Dec 04 2006 - 07:12:26 PST

This archive was generated by hypermail 2.2.0 : Mon Dec 04 2006 - 07:12:29 PST