Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make pro forma workflow consistent with other Urbansim models #10

Closed
pksohn opened this issue Feb 1, 2017 · 0 comments
Closed

Make pro forma workflow consistent with other Urbansim models #10

pksohn opened this issue Feb 1, 2017 · 0 comments

Comments

@pksohn
Copy link
Contributor

pksohn commented Feb 1, 2017

As a modeler, I should be able to use the pro forma model in a consistent manner with other urbansim models.

Overview

Currently, the workflow looks like this:

pf = sqftproforma.SqFtProForma()

df = parcels.to_frame()

# add prices for each use
for use in pf.config.uses:
    df[use] = parcel_price_callback(use)

# convert from cost to yearly rent
if residential_to_yearly:
    df["residential"] *= pf.config.cap_rate

d = {}
for form in pf.config.forms:
    print "Computing feasibility for form %s" % form
    d[form] = pf.lookup(form, df[parcel_use_allowed_callback(form)])

far_predictions = pd.concat(d.values(), keys=d.keys(), axis=1)

sim.add_table("feasibility", far_predictions)

I would like to make this consistent with calls to other urbansim models in utils.py, such as hedonic_simulate. The function could look something like this:

cfg = misc.config(cfg)
df = parcels.to_frame()
feasibility = proforma.lookup(df, cfg)
orca.add_table('feasibility', feasibility)

This has the dual benefit of simplifying the function call to the core model, and making the workflow more consistent with other urbansim models.

Details

For now, this simply requires moving these steps from utils.py into the SqftProForma lookup method. New parameters to add to the configuration options are:

  • parcel_filter
  • residential_to_yearly
  • simple_zoning

Refactoring will be considered in the v0.1.1 milestone.

@pksohn pksohn changed the title Cleaner SqftProForma API Make developer workflow consistent with other Urbansim models Feb 1, 2017
@pksohn pksohn modified the milestone: Version 0.1.0 Feb 1, 2017
@pksohn pksohn changed the title Make developer workflow consistent with other Urbansim models Make pro forma workflow consistent with other Urbansim models Feb 2, 2017
@conorhenley conorhenley assigned pksohn and unassigned conorhenley Feb 6, 2017
@pksohn pksohn closed this as completed Feb 10, 2017
@pksohn pksohn modified the milestone: UDST v0.1 Mar 10, 2017
@pksohn pksohn removed their assignment Apr 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants