Commit 35cb50c7 authored by Tara Evaz Zadeh's avatar Tara Evaz Zadeh Committed by Tara Evaz Zadeh
Browse files

Modified calling the create_damage_view

parent 753eb2b9
Pipeline #54805 failed with stage
in 2 minutes and 24 seconds
......@@ -187,25 +187,14 @@ def damage_calculator(
logger.info("Entity %d computed" % entity_count)
# Create the necessary views
for idx, name in damage_state_names:
db.create_damage_view(
"building_" + str(assessment_source_id) + "_" + str(name),
"building",
assessment_source_id,
idx,
)
db.create_damage_view(
"residual_" + str(assessment_source_id) + "_" + str(name),
"residual",
assessment_source_id,
idx,
for view_aggregation_type in "building", "residual":
damage_view_name = (
"view_" + view_aggregation_type + "_damage_" + str(assessment_source_id)
)
db.create_damage_view(
"tile_" + str(assessment_source_id) + "_" + str(name),
"tile",
assessment_source_id,
idx,
damage_view_name, view_aggregation_type, assessment_source_id, damage_state_names
)
logger.info(f"Damage view {damage_view_name} created")
# Commit all damage assessments and close
db.connection.commit()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment