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

Add SF parcel model, make compatible with new pro forma model #1

Merged
merged 6 commits into from
Feb 10, 2017

Conversation

pksohn
Copy link
Contributor

@pksohn pksohn commented Feb 9, 2017

This is a large PR with two main pieces: 1) Adding the SF example parcel model, which is a mashup of urbansim_parcels and sanfran_urbansim, and 2) Making the parcel model compatible with the new pro forma model in the developer repo.

Adding the SF parcel model

I've added several new files that are directly copied from sanfran_urbansim:

  • sf_example/configs/elcm.yaml
  • sf_example/configs/hlcm.yaml
  • sf_example/configs/rsh.yaml
  • sf_example/configs/nrh.yaml
  • sf_example/data/sanfran_public.h5
  • sf_example/data/zones.json

These two were modified from jupyter notebooks in sanfran_urbansim but are more or less the same:

  • sf_example/estimate.py
  • sf_example/simulate.py

This was brought over from urbansim_parcels and made compatible with the sanfran_urbansim data and specifications. It contains most of the same things as assumptions.py from sanfran_urbansim but changed to YAML format.

  • sf_example/configs/settings.yaml

The major changes are in these files. You'll see a variety of modified or added model steps, variable definitions, etc. If I haven't talked specifically about the change in the next section, it's probably just me cobbling things together between urbansim_defaults and sanfran_urbansim to work with the SF data:

  • urbansim_parcels/models.py
  • urbansim_parcels/variables.py
  • urbansim_parcels/datasources.py
  • urbansim_parcels/utils.py

Compatibility with the new developer model

There are some key changes I've made in the pro forma model to work with the new format:

utils.py

The bulk of the changes are here.

  • Got rid of most of the parameters in the old run_feasibility function. These are now pro forma configuration items, either set in proforma.yaml or grabbed from default values in the pro forma object itself.
  • See those items in the pro forma constructor method here.
  • Split the run_feasibility function into prepare_parcels_for_feasibility and lookup_by_form. The run_feasibility function still exists to call the above functions, but this now looks much more in line with other functions.

models.py

In feasibility step, now loading pro forma configs directly from an injectable called proforma, which is registered from proforma.yaml (see settings.yaml section below).

settings.yaml

You don't actually have to refer to the code here. Just note that urbansim_defaults assumed there were some pro forma related configs in this file. In the new version, I want all pro forma related configs to live in proforma.yaml.

datasources.py

New injectable to load proforma.yaml. Note that if there is no file there, it registers None which will later instantiate the SqftProForma object from defaults.

variables.py

See the callback functions. These are called in the new prepare_parcels_for_feasibility and lookup_by_form functions in utils.py.

This commit involves, regrettably, a large number of hacky
changes that represent a mashup of sanfran_urbansim
and urbansim_defaults. This goal is to have a good replacement
of the two that has data ready to go and a reasonable configuration,
while maintaining some generalizability.

The current version of this sf_example directory is tenuous
and we'll need to do some serious work. This commit was to bring it up
to compatibility with the new pro forma module.
@conorhenley conorhenley merged commit 3d05e03 into master Feb 10, 2017
@conorhenley conorhenley deleted the developer branch February 10, 2017 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants