Re: [UrbanSim-Users] estimating development_project_location_choice_model

From: Hana Sevcikova <hana_at_cs.washington.edu>
Date: Fri, 11 Jan 2008 14:32:58 -0800

Here is the cause (and solution) to this problem:

When estimating the DPLCM, the code needs to determine capacity in
previous years. Thus, it needs a few datasets available in the cache of
the previous years. Those datasets are defined in the entry
tables_to_copy_to_previous_years of your configuration. It turned out
that the eugene configuration is missing one table here
(development_constraints) which causes your error. I have updated it in
the repository. The correct entry looks like this:

tables_to_copy_to_previous_years = {
                     'development_type_group_definitions': 1975,
                     'development_type_groups': 1975,
                     'development_types': 1975,
                     'development_constraints':1975,
                     'urbansim_constants': 1975,
                     },

You can either modify your configuration file and rerun the script
opus_core/tools/create_baseyear_cache.py. If the entry cache_directory
points to an existing cache nothing will be cached, but gridcells will
be unrolled again and the correct datasets copied to the previous years.

Alternatively, just copy the directory development_constraints from your
base year cache to the earliest year you have data for.

I hope this will work.

Hana

Brian Miles wrote:
>
> Hi Hana,
>
> We checked this out and in the process built a simplified
> development_constraints table (see below) that we hoped would work for
> now, but sadly it did not.
>
> What else should we look at?
>
> Also, we don't understand well why before the estimation of
> dplcm-residential, for which we've only specified one variable
> (urbansim.gridcell.ln_residential_units) for our current testing, the
> land price model is being run. I suppose it's run before the estimation
> because land prices are a criterion for dplcm, but I'm wondering where
> this relationship is defined if not in the dplcm model specification.
>
> Thanks,
>
> Brian
>
> mysql> select * from development_constraints;
> +---------------+---------+---------------+-----------+-----------+-------------
>
> --------+---------------------+---------------------+---------------------+
> | CONSTRAINT_ID | CITY_ID | IS_IN_WETLAND | MIN_UNITS | MAX_UNITS |
> MIN_COMMERCIAL_SQFT | MAX_COMMERCIAL_SQFT | MIN_INDUSTRIAL_SQFT |
> MAX_INDUSTRIAL_SQFT |
> +---------------+---------+---------------+-----------+-----------+---------------------+---------------------+---------------------+---------------------+
>
> | 1 | -1 | 1 | 0 | 10
> | 0 | 1000 | 0 |
> 10000 |
> +---------------+---------+---------------+-----------+-----------+---------------------+---------------------+---------------------+---------------------+
>
> 1 row in set (0.00 sec)
>
> On Jan 8, 2008, at 1:19 PM, Hana Sevcikova wrote:
>
>> Brian,
>>
>> My suspicion is that there is something wrong with the column names of
>> your development_constraints table. Could you check please that the
>> table header corresponds to that described in
>> http://www.urbansim.org/docs/opus-userguide/node251.html
>>
>> Thanks,
>>
>> Hana
>>
>>
>> Brian Miles wrote:
>>> Hello,
>>> I'm trying to estimate the
>>> residential_development_project_location_choice_model. I'm getting
>>> the following error in the compute method of
>>> total_maximum_development_SSS.py. Before I spent too much time
>>> digging, I wanted to see if anyone had encountered something like this.
>>> Thanks,
>>> Brian Miles
>>> Graduate Assistant
>>> Spatial Analysis Lab - Rubenstein School of Environment and Natural
>>> Resources
>>> University of Vermont
>>> excerpt from stack trace:
>>> File "C:\opusworkspace-svn\urbansim\gridcell
>>> \total_maximum_development_SSS.py"
>>> , line 40, in compute
>>> index=where(is_developable)[0])[self.type][:,
>>> 1]).astype(self._return_type)
>>> File "C:\opusworkspace-svn\urbansim\datasets\gridcell_dataset.py",
>>> line 56, in
>>> get_development_constrained_capacity
>>> constraints.get_attribute_names(), ["min", "max"])
>>> File "C:\opusworkspace-svn\opus_core\misc.py", line 325, in
>>> remove_elements_wi
>>> th_matched_prefix_from_list
>>> m = apply_along_axis(match_prefix, 1, pl.reshape(pl.size,1),
>>> array(valuelist
>>> ))
>>> File "C:\Python25\lib\site-packages\numpy-1.0.3-py2.5-win32.egg
>>> \numpy\lib\shap
>>> e_base.py", line 30, in apply_along_axis
>>> res = func1d(arr[tuple(i.tolist())],*args)
>>> File "C:\opusworkspace-svn\opus_core\misc.py", line 320, in
>>> match_prefix
>>> t = apply_along_axis(match_single_element, 1,
>>> arr.reshape(arr.size,1), prefi
>>> x[0])
>>> File "C:\Python25\lib\site-packages\numpy-1.0.3-py2.5-win32.egg
>>> \numpy\lib\shap
>>> e_base.py", line 30, in apply_along_axis
>>> res = func1d(arr[tuple(i.tolist())],*args)
>>> IndexError: invalid index
>>> _______________________________________________
>>> Users mailing list
>>> Users_at_urbansim.org
>>> http://www.urbansim.org/mailman/listinfo/users
>
Received on Fri Jan 11 2008 - 14:32:59 PST

This archive was generated by hypermail 2.2.0 : Fri Jan 11 2008 - 14:33:01 PST