Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Dynamic Exposure
Global Dynamic Exposure
losscalculator
Commits
949644e3
Commit
949644e3
authored
Feb 02, 2021
by
Tara Evaz Zadeh
Browse files
Fixed the bug appearing when there is only one cell for computation
parent
0568bafd
Pipeline
#19016
passed with stage
in 1 minute and 48 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
examples/example_cell/data/cell_ids.csv
View file @
949644e3
unique
C
ell
I
ds
unique
_c
ell
_i
ds
cell_2423204507
cell_2423204508
losscalculator/damage_calculator.py
View file @
949644e3
...
...
@@ -45,7 +45,7 @@ def get_exposure_per_tile(
full_ground_motion_field
=
losslib
.
get_full_GMF
(
ground_motion_field
,
lons_whole_area
,
lats_whole_area
,
interpolation_method
)
cell_ids
=
np
.
loadtxt
(
cell_id_source_filepath
,
dtype
=
"str"
,
skiprows
=
1
)
cell_ids
=
pd
.
read_csv
(
cell_id_source_filepath
)
with
open
(
result_filepath
,
"a+"
,
newline
=
""
)
as
write_obj
:
csv_writer
=
csv
.
writer
(
write_obj
)
if
exposure_type
==
"building"
:
...
...
@@ -119,7 +119,7 @@ def get_exposure_per_tile(
csv_writer
.
writerow
(
title
)
for
i
in
range
(
cell_ids
.
shape
[
0
]):
cell_id
=
cell_ids
[
i
]
cell_id
=
cell_ids
.
loc
[
i
][
0
]
exposure_per_tile
=
exposure
.
loc
[
exposure
[
tile_id
]
==
cell_id
]
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment