Add SF parcel model, make compatible with new pro forma model #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a large PR with two main pieces: 1) Adding the SF example parcel model, which is a mashup of
urbansim_parcels
andsanfran_urbansim
, and 2) Making the parcel model compatible with the new pro forma model in thedeveloper
repo.Adding the SF parcel model
I've added several new files that are directly copied from
sanfran_urbansim
:These two were modified from jupyter notebooks in
sanfran_urbansim
but are more or less the same:This was brought over from
urbansim_parcels
and made compatible with thesanfran_urbansim
data and specifications. It contains most of the same things asassumptions.py
fromsanfran_urbansim
but changed to YAML format.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
andsanfran_urbansim
to work with the SF data: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.
proforma.yaml
or grabbed from default values in the pro forma object itself.prepare_parcels_for_feasibility
andlookup_by_form
. Therun_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 fromproforma.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 inproforma.yaml
.datasources.py
New injectable to load
proforma.yaml
. Note that if there is no file there, it registersNone
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
.