Skip to content

Commit

Permalink
Fix vertical settlement test.
Browse files Browse the repository at this point in the history
  • Loading branch information
LanaTodorovic93 committed Sep 30, 2023
1 parent 147c3a7 commit b5cbb2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
12 changes: 6 additions & 6 deletions openquake/sep/tests/liquefaction/test_vertical_settlement.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
class TestHazusVerticalSettlement(unittest.TestCase):
def setUp(self):
self.all_liq_types = ['vh', 'h', 'm', 'l', 'vl', 'n']
self.mag = 7.5
self.pga = np.array([0.15, 0.20, 0.25, 0.30, 0.35, 0.40])
# self.mag = 7.5
# self.pga = np.array([0.15, 0.20, 0.25, 0.30, 0.35, 0.40])

def test_hazus_vertical_settlement_list_m(self):
v_settle = hazus_vertical_settlement(self.all_liq_types, mag=self.mag,pga=self.pga, return_unit='m')
v_settle = hazus_vertical_settlement(self.all_liq_types, return_unit='m')
np.testing.assert_array_almost_equal(
v_settle,
np.array([0.039243, 0.017734, 0.003213, 0.000591, 0., 0.])
np.array([0.3048, 0.1524, 0.0508, 0.0254, 0., 0.])
)

def test_hazus_vertical_settlement_list_in(self):
v_settle = hazus_vertical_settlement(self.all_liq_types, mag=self.mag,pga=self.pga, return_unit='in')
v_settle = hazus_vertical_settlement(self.all_liq_types, return_unit='in')
np.testing.assert_array_almost_equal(
v_settle,
np.array([1.545019, 0.698172, 0.126501, 0.023263, 0. , 0.])
np.array([12., 6., 2., 1., 0., 0.])
)
19 changes: 1 addition & 18 deletions openquake/sep/tests/test_sep_suite_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
hazus_lateral_spreading_displacement
)

from openquake.sep.liquefaction.vertical_settlement import (
HAZUS_VERT_SETTLEMENT_TABLE,
hazus_vertical_settlement)

BASE_DATA_PATH = os.path.join(os.path.dirname(__file__), "data")
site_data_file = os.path.join(BASE_DATA_PATH, "test_site_params.csv")

Expand Down Expand Up @@ -288,17 +284,4 @@ def test_hazus_liquefaction_displacements(self):
disps = np.array([0.53306034, 2.33933074, 0.74434279, 2.168416,
3.84597609, 0.36615681, 0., 0., 1.15887168, 1.3722039 ])

np.testing.assert_array_almost_equal(self.sites.hazus_lat_disp, disps)

def test_hazus_vertical_settlements(self):

self.sites["char_settlement"] = hazus_vertical_settlement(liq_susc_cat=self.sites["liq_susc_cat"],
pga=self.pga, mag=self.mag,
groundwater_depth=self.sites["gwd"],
do_map_proportion_correction=self.map_proportion_flag ,
)

disps = np.array([0.031563264, 0.001226741, 0.031563264, 0.001184827,
0.031563264, 0.031563264, 0, 0, 0.001184827, 0.001184827])

np.testing.assert_array_almost_equal(self.sites["char_settlement"], disps)
np.testing.assert_array_almost_equal(self.sites.hazus_lat_disp, disps)

0 comments on commit b5cbb2b

Please sign in to comment.