Standard Energy Efficiency Data (SEED) Platform™ is a web-based application that helps organizations easily manage data on the energy performance of large groups of buildings.
Other
111
stars
54
forks
source link
Bug linking properties across cycles when UBID is matching criteria #4774
Step 6 linking function does not account for the UBID Jaccard Index (as it does in the step 4 matching function).
This can lead to two error scenarios if properties have matching pm_property_ids (or other matching criteria), but different UBIDs. Consider the following setup.
If P1 and P3 are uploaded to Cycle 1, they will appear as distinct properties as step 4 accounts for UBID. When P2 is uploaded to Cycle 2 we end up with an integrity error and the app hangs
Add the jaccard checking logic from step 4 to step 6.
Add a check_jaccard boolean argument to link_states
Insert jaccard checking logic into the for loop within function link_states
for idx, state in enumerate(states):
existing_state_matches = match_lookup.get(tuple(getattr(state, c) for c in tuple_values), [])
if check_jaccard:
existing_state_matches = [
existing_state
for existing_state in existing_state_matches
if existing_state.get("ubid")
and check_jaccard_match(matching_criteria.get("ubid"), existing_state.get("ubid"), org.ubid_threshold)
]
existing_views_matches = [view_lookup[x["id"]] for x in existing_state_matches]
...
Issue
Step 6 linking function does not account for the UBID Jaccard Index (as it does in the step 4 matching function).
This can lead to two error scenarios if properties have matching pm_property_ids (or other matching criteria), but different UBIDs. Consider the following setup.
Proposed solution:
Add the jaccard checking logic from step 4 to step 6.
check_jaccard
boolean argument to link_statesInsert jaccard checking logic into the for loop within function
link_states