Skip to content
Snippets Groups Projects
Commit c2b10e15 authored by Tara Evaz Zadeh's avatar Tara Evaz Zadeh
Browse files

Corrected import of losscalculator-related packages

parent d0ff7e29
No related tags found
1 merge request!112Resolve "Correct the entry point in the `losscalculator`"
Pipeline #48314 passed
......@@ -24,9 +24,9 @@ import sys
import numpy as np
from .fragility_model import FragilityModel
from .ground_motion import GMField
from .losslib import get_full_gm_field
from losscalculator.fragility_model import FragilityModel
from losscalculator.ground_motion import GMField
from losscalculator.losslib import get_full_gm_field
from exposurelib.database import ExposureDatabase
from exposurelib.utils import split_taxonomy
......@@ -121,10 +121,7 @@ def damage_calculator(
# Interpolate the ground-motion values for all the assets of the exposure model.
# pylint: disable=E1101
full_gm_field = get_full_gm_field(
gm_field.data,
entity_locations[:, 0],
entity_locations[:, 1],
interpolation_method,
gm_field.data, entity_locations[:, 0], entity_locations[:, 1], interpolation_method
)
for entity_idx, entity in enumerate(entity_locations):
sql_statement = "INSERT INTO GMField "
......@@ -160,8 +157,7 @@ def damage_calculator(
):
reduced_taxonomy, _ = split_taxonomy(taxonomy)
prob_of_exceed, prob_of_occurrence, im_value, im_type = fragility_model(
reduced_taxonomy,
full_gm_field[data_row],
reduced_taxonomy, full_gm_field[data_row]
)
probabilities_per_asset.append([i * num_buildings for i in prob_of_occurrence])
asset_count += 1
......@@ -271,11 +267,7 @@ def command_line_interface():
+ "intensity measure types that you have in your fragility functions",
)
parser.add_argument(
"-e",
"--exposure",
required=False,
type=str,
help="path to the exposure database file.",
"-e", "--exposure", required=False, type=str, help="path to the exposure database file."
)
parser.add_argument(
"-s",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment