Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
losscalculator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Global Dynamic Exposure
losscalculator
Commits
c2b10e15
You need to sign in or sign up before continuing.
Commit
c2b10e15
authored
2 years ago
by
Tara Evaz Zadeh
Browse files
Options
Downloads
Patches
Plain Diff
Corrected import of losscalculator-related packages
parent
d0ff7e29
Branches
feature/relative-submodules
No related tags found
1 merge request
!112
Resolve "Correct the entry point in the `losscalculator`"
Pipeline
#48314
passed
2 years ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
losscalculator/damage_calculator.py
+6
-14
6 additions, 14 deletions
losscalculator/damage_calculator.py
with
6 additions
and
14 deletions
losscalculator/damage_calculator.py
+
6
−
14
View file @
c2b10e15
...
...
@@ -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
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment