seed.lib.merging package

Submodules

seed.lib.merging.merging module

:copyright (c) 2014 - 2022, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Department of Energy) and contributors. All rights reserved. :author Dan Gunter <dkgunter@lbl.gov>

seed.lib.merging.merging.get_attrs_with_mapping(data_set_buildings, mapping)

Returns a dictionary of attributes from each data_set_building.

Parameters
  • data_set_buildings – list, instances to merge.

  • mapping

Returns

dict: possible attributes keyed on attr name.

seed.lib.merging.merging.get_propertystate_attrs(data_set_buildings)
seed.lib.merging.merging.get_state_attrs(state_list)

Return a list of state attributes. This does not include any of the extra data columns

seed.lib.merging.merging.get_state_to_state_tuple(inventory)

Return the list of the database fields based on the inventory type

seed.lib.merging.merging.get_taxlotstate_attrs(data_set_buildings)
seed.lib.merging.merging.merge_state(merged_state, state1, state2, priorities, ignore_merge_protection=False)

Set attributes on our Canonical model, saving differences.

Parameters
  • merged_state – PropertyState/TaxLotState model inst.

  • state1 – PropertyState/TaxLotState model inst. Left parent.

  • state2 – PropertyState/TaxLotState model inst. Right parent.

  • priorities – dict, column names with favor new or existing

Returns

inst(merged_state), updated.

Module contents