seed.lib.merging package

Submodules

seed.lib.merging.merging module

SEED Platform (TM), Copyright (c) Alliance for Sustainable Energy, LLC, and other contributors. See also https://github.com/seed-platform/seed/main/LICENSE.md

: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