Skip to content

Commit

Permalink
Merge branch 'master' into change-to-job-spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
fscottfoti committed Aug 4, 2014
2 parents f2738b1 + d68cb41 commit e41c807
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
6 changes: 4 additions & 2 deletions urbansim/developer/sqftproforma.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,6 @@ def lookup(self, form, df, only_built=True):
# min between max_fars and max_heights
df['max_far_from_heights'] = df.max_height / c.height_per_story * \
c.parcel_coverage
df['min_max_fars'] = df[['max_far_from_heights', 'max_far']].min(axis=1)

# now also minimize with max_dua from zoning - since this pro forma is really geared
# toward per sqft metrics, this is a bit tricky. dua is converted to floorspace and
Expand All @@ -552,7 +551,10 @@ def lookup(self, form, df, only_built=True):
# if max_dua is in the data frame, ave_unit_size must also be present
assert 'ave_unit_size' in df.columns
df['max_far_from_dua'] = df.max_dua * df.ave_unit_size / self.config.building_efficiency
df['min_max_fars'] = df[['min_max_fars', 'max_far_from_dua']].min(axis=1)
df['min_max_fars'] = df[['max_far_from_heights', 'max_far',
'max_far_from_dua']].min(axis=1)
else:
df['min_max_fars'] = df[['max_far_from_heights', 'max_far']].min(axis=1)

if only_built:
df = df.query('min_max_fars > 0 and parcel_size > 0')
Expand Down
1 change: 1 addition & 0 deletions urbansim/models/lcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,7 @@ def columns_used(self):
self.choosers_columns_used(),
self.alts_columns_used(),
self.interaction_columns_used(),
util.columns_in_formula(self.default_model_expr),
[self.segmentation_col])))

@classmethod
Expand Down
1 change: 1 addition & 0 deletions urbansim/models/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,7 @@ def columns_used(self):
return list(toolz.unique(toolz.concatv(
util.columns_in_filters(self.fit_filters),
util.columns_in_filters(self.predict_filters),
util.columns_in_formula(self.default_model_expr),
self._group.columns_used(),
[self.segmentation_col])))

Expand Down
3 changes: 3 additions & 0 deletions urbansim/models/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ def columns_in_formula(formula):
columns : list of str
"""
if formula is None:
return []

formula = str_model_expression(formula, add_constant=False)
columns = []

Expand Down
5 changes: 4 additions & 1 deletion urbansim/sim/simulation.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
from __future__ import print_function

import logging
import inspect
import logging
import warnings
from collections import Callable, namedtuple

import pandas as pd
import tables
import toolz
import time

from ..utils.misc import column_map
from ..utils.logutil import log_start_finish

warnings.filterwarnings('ignore', category=tables.NaturalNameWarning)
logger = logging.getLogger(__name__)

_TABLES = {}
Expand Down

0 comments on commit e41c807

Please sign in to comment.