(self)
Run the developer model on all possible inputs specified in the
        configuration object - not generally called by the user.  This part
        computes the final cost per sqft of the building to construct and
        then turns it into the yearly rent necessary to make break even on
        that cost.
Run the developer model on all possible inputs specified in the
        configuration object - not generally called by the user.  This part
        computes the final cost per sqft of the building to construct and
        then turns it into the yearly rent necessary to make break even on
        that cost.
Run the developer model on all possible inputs specified in the configuration object - not generally called by the user . This part computes the final cost per sqft of the building to construct and then turns it into the yearly rent necessary to make break even on that cost .
def _generate_lookup(self):
        """
        Run the developer model on all possible inputs specified in the
        configuration object - not generally called by the user.  This part
        computes the final cost per sqft of the building to construct and
        then turns it into the yearly rent necessary to make break even on
        that cost.

        """
        c = self.config

        # get all the building forms we can use
        keys = c.forms.keys()
        keys = sorted(keys)
        df_d = {}
        for name in keys:
            # get the use distribution for each
            uses_distrib = c.forms[name]

            for parking_config in c.parking_configs:

                # going to make a dataframe to store values to make
                # pro forma results transparent
                df = pd.DataFrame(index=c.fars)
                df['far'] = c.fars
                df['pclsz'] = c.tiled_parcel_sizes

                building_bulk = np.reshape(
                    c.parcel_sizes, (-1, 1)) * np.reshape(c.fars, (1, -1))
                building_bulk = np.reshape(building_bulk, (-1, 1))

                # need to converge in on exactly how much far is available for
                # deck pkg
                if parking_config == 'deck':
                    building_bulk /= (1.0 + np.sum(uses_distrib * c.parking_rates) *
                                      c.parking_sqft_d[parking_config] /
                                      c.sqft_per_rate)

                df['building_sqft'] = building_bulk

                parkingstalls = building_bulk * \
                    np.sum(uses_distrib * c.parking_rates) / c.sqft_per_rate
                parking_cost = (c.parking_cost_d[parking_config] *
                                parkingstalls *
                                c.parking_sqft_d[parking_config])

                df['spaces'] = parkingstalls

                if parking_config == 'underground':
                    df['park_sqft'] = parkingstalls * \
                        c.parking_sqft_d[parking_config]
                    stories = building_bulk / c.tiled_parcel_sizes
                if parking_config == 'deck':
                    df['park_sqft'] = parkingstalls * \
                        c.parking_sqft_d[parking_config]
                    stories = ((building_bulk + parkingstalls *
                                c.parking_sqft_d[parking_config]) /
                               c.tiled_parcel_sizes)
                if parking_config == 'surface':
                    stories = building_bulk / \
                        (c.tiled_parcel_sizes - parkingstalls *
                         c.parking_sqft_d[parking_config])
                    df['park_sqft'] = 0
                    # not all fars support surface parking
                    stories[stories < 0.0] = np.nan
                    # I think we can assume that stories over 3
                    # do not work with surface parking
                    stories[stories > 5.0] = np.nan

                df['total_built_sqft'] = df.building_sqft + df.park_sqft
                df['parking_sqft_ratio'] = df.park_sqft / df.total_built_sqft
                stories /= c.parcel_coverage
                df['stories'] = np.ceil(stories)
                df['height'] = df.stories * c.height_per_story
                df['build_cost_sqft'] = self._building_cost(uses_distrib, stories)

                df['build_cost'] = df.build_cost_sqft * df.building_sqft
                df['park_cost'] = parking_cost
                df['cost'] = df.build_cost + df.park_cost

                df['ave_cost_sqft'] = (df.cost / df.total_built_sqft) * c.profit_factor

                if name == 'retail':
                    df['ave_cost_sqft'][c.fars > c.max_retail_height] = np.nan
                if name == 'industrial':
                    df['ave_cost_sqft'][c.fars > c.max_industrial_height] = np.nan

                df_d[(name, parking_config)] = df

        self.dev_d = df_d
def _generate_lookup ( self ) : c = self . config # get all the building forms we can use keys = c . forms . keys ( ) keys = sorted ( keys ) df_d = { } for name in keys : # get the use distribution for each uses_distrib = c . forms [ name ] for parking_config in c . parking_configs : # going to make a dataframe to store values to make # pro forma results transparent df = pd . DataFrame ( index = c . fars ) df [ 'far' ] = c . fars df [ 'pclsz' ] = c . tiled_parcel_sizes building_bulk = np . reshape ( c . parcel_sizes , ( - 1 , 1 ) ) * np . reshape ( c . fars , ( 1 , - 1 ) ) building_bulk = np . reshape ( building_bulk , ( - 1 , 1 ) ) # need to converge in on exactly how much far is available for # deck pkg if parking_config == 'deck' : building_bulk /= ( 1.0 + np . sum ( uses_distrib * c . parking_rates ) * c . parking_sqft_d [ parking_config ] / c . sqft_per_rate ) df [ 'building_sqft' ] = building_bulk parkingstalls = building_bulk * np . sum ( uses_distrib * c . parking_rates ) / c . sqft_per_rate parking_cost = ( c . parking_cost_d [ parking_config ] * parkingstalls * c . parking_sqft_d [ parking_config ] ) df [ 'spaces' ] = parkingstalls if parking_config == 'underground' : df [ 'park_sqft' ] = parkingstalls * c . parking_sqft_d [ parking_config ] stories = building_bulk / c . tiled_parcel_sizes if parking_config == 'deck' : df [ 'park_sqft' ] = parkingstalls * c . parking_sqft_d [ parking_config ] stories = ( ( building_bulk + parkingstalls * c . parking_sqft_d [ parking_config ] ) / c . tiled_parcel_sizes ) if parking_config == 'surface' : stories = building_bulk / ( c . tiled_parcel_sizes - parkingstalls * c . parking_sqft_d [ parking_config ] ) df [ 'park_sqft' ] = 0 # not all fars support surface parking stories [ stories < 0.0 ] = np . nan # I think we can assume that stories over 3 # do not work with surface parking stories [ stories > 5.0 ] = np . nan df [ 'total_built_sqft' ] = df . building_sqft + df . park_sqft df [ 'parking_sqft_ratio' ] = df . park_sqft / df . total_built_sqft stories /= c . parcel_coverage df [ 'stories' ] = np . ceil ( stories ) df [ 'height' ] = df . stories * c . height_per_story df [ 'build_cost_sqft' ] = self . _building_cost ( uses_distrib , stories ) df [ 'build_cost' ] = df . build_cost_sqft * df . building_sqft df [ 'park_cost' ] = parking_cost df [ 'cost' ] = df . build_cost + df . park_cost df [ 'ave_cost_sqft' ] = ( df . cost / df . total_built_sqft ) * c . profit_factor if name == 'retail' : df [ 'ave_cost_sqft' ] [ c . fars > c . max_retail_height ] = np . nan if name == 'industrial' : df [ 'ave_cost_sqft' ] [ c . fars > c . max_industrial_height ] = np . nan df_d [ ( name , parking_config ) ] = df self . dev_d = df_d