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.
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.
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
.