SEMCOG / semcog_urbansim

7 stars 6 forks source link

Newly added buildings from `scheduled_development_events` required `mcd_model_quota` #31

Closed tianxie1995 closed 2 years ago

tianxie1995 commented 2 years ago

The current building template for newly added buildings from scheduled_development_events won't generate mcd_model_quota which is resulting in the following error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/da/anaconda3/lib/python3.7/site-packages/orca/orca.py", line 2168, in run
    step()
  File "/home/da/anaconda3/lib/python3.7/site-packages/orca/orca.py", line 973, in __call__
    return self._func(**kwargs)
  File "/home/da/semcog_urbansim/models.py", line 961, in scheduled_development_events
    all_buildings = parcel_utils.merge_buildings(b, sched_dev[b.columns], False)
  File "/home/da/anaconda3/lib/python3.7/site-packages/pandas/core/frame.py", line 3030, in __getitem__
    indexer = self.loc._get_listlike_indexer(key, axis=1, raise_missing=True)[1]
  File "/home/da/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py", line 1266, in _get_listlike_indexer
    self._validate_read_indexer(keyarr, indexer, axis, raise_missing=raise_missing)
  File "/home/da/anaconda3/lib/python3.7/site-packages/pandas/core/indexing.py", line 1316, in _validate_read_indexer
    raise KeyError(f"{not_found} not in index")
KeyError: "['mcd_model_quota'] not in index"

Solution: in models.py>add_extra_columns_res, added default mcd_model_quota to the buildings tobe generated.

tianxie1995 commented 2 years ago

Set the mcd_model_quota to be residential_unit as default