Closed cvanoli closed 4 years ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
developer/develop.py | 0 | 1 | 0.0% | ||
<!-- | Total: | 0 | 1 | 0.0% | --> |
Totals | |
---|---|
Change from base Build 52: | 0.0% |
Covered Lines: | 789 |
Relevant Lines: | 829 |
Linking things up, this fixes the bug identified in https://github.com/UDST/developer/pull/71#issuecomment-574852680.
The
_select_buildings
is a function inside the Developer object. The function selects buildings using theself.target_units
, a developer property, which can be passed as a Float or as a pd.DataFrame with the columntarget_units
. Withself.target_units
, a float variable calledtarget_units
is created being theself.target_units
itself, it this is a Float, or a sum of the target_units column ifself.target_units
is a DataFrame. Then, the selection of buildings can be done through three methods: a custom selection passed by the user calledcustom_selection_func
, theweighted_random_choice_multiparcel
method from proposal_select.py or theweighted_random_choice
method also from proposal_select.py. The three functions uses thetarget_units
as inputs. The two latter, defined in proposal_select.py needs a Float type as thetarget_units
input, so the variabletarget_units
that was created is passed into these. But, as thecustom_selection_func
is a function that is defined and passed by the user, we assume that it will designed to take as input the originaltarget_units
that is passed to create the developer object. Therefore, the parameter to pass into thecustom_selection_func
should beself.target_units
instead oftarget_units
, since in the caseself.target_units
is a pd.DataFrame, thecustom_selection_func
will be expecting that type, instead of a Float which is the local variabletarget_units
.