def test_parse_mfd_simple_fault(self): expected = models.MfdEvd( max_val=6.9500000000000002, total_cumulative_rate=1.8988435199999998e-05, min_val=6.5499999999999998, bin_size=0.10000000000000009, mfd_values=[ 0.0010614989, 0.00088291626999999998, 0.00073437776999999999, 0.00061082879999999995, 0.00050806530000000003], total_moment_rate=281889786038447.25) mfd = self.simple.getMfd() # Assume that this is an 'evenly discretized' MFD # We want to do this check so we know right away if our test data # has been altered. mfd_type = mfd.__javaclass__.getName() self.assertEqual( '%s.IncrementalMagFreqDist' % db_loader.MFD_PACKAGE, mfd_type) # this is the dict we'll be passing to Django to do the db insert mfd_insert = db_loader.parse_mfd(self.simple, mfd) helpers.assertModelAlmostEqual(self, expected, mfd_insert)
def test_parse_mfd_simple_fault(self): expected = { 'table': 'hzrdi.mfd_evd', 'data': { 'max_val': 6.9500000000000002, 'total_cumulative_rate': 1.8988435199999998e-05, 'min_val': 6.5499999999999998, 'bin_size': 0.10000000000000009, 'mfd_values': [ 0.0010614989, 0.00088291626999999998, 0.00073437776999999999, 0.00061082879999999995, 0.00050806530000000003], 'total_moment_rate': 281889786038447.25, 'owner_id': None}} mfd = self.simple.getMfd() # Assume that this is an 'evenly discretized' MFD # We want to do this check so we know right away if our test data # has been altered. mfd_type = mfd.__javaclass__.getName() self.assertEqual( '%s.IncrementalMagFreqDist' % db_loader.MFD_PACKAGE, mfd_type) # this is the dict we'll be passing to sqlalchemy to do the db insert mfd_insert = db_loader.parse_mfd(self.simple, mfd) helpers.assertDictAlmostEqual(self, expected, mfd_insert)
def test_parse_mfd_simple_fault(self): expected = models.MfdEvd(max_val=6.9500000000000002, total_cumulative_rate=1.8988435199999998e-05, min_val=6.5499999999999998, bin_size=0.10000000000000009, mfd_values=[ 0.0010614989, 0.00088291626999999998, 0.00073437776999999999, 0.00061082879999999995, 0.00050806530000000003 ], total_moment_rate=281889786038447.25) mfd = self.simple.getMfd() # Assume that this is an 'evenly discretized' MFD # We want to do this check so we know right away if our test data # has been altered. mfd_type = mfd.__javaclass__.getName() self.assertEqual('%s.IncrementalMagFreqDist' % db_loader.MFD_PACKAGE, mfd_type) # this is the dict we'll be passing to Django to do the db insert mfd_insert = db_loader.parse_mfd(self.simple, mfd) helpers.assertModelAlmostEqual(self, expected, mfd_insert)
def test_parse_mfd_complex_fault(self): expected = models.MfdTgr(b_val=0.80000000000000004, total_cumulative_rate=4.933442096397671e-10, min_val=6.5499999999999998, max_val=8.9499999999999993, total_moment_rate=198544639016.43918, a_val=1.0) mfd = self.complex.getMfd() mfd_type = mfd.__javaclass__.getName() self.assertEqual( '%s.GutenbergRichterMagFreqDist' % db_loader.MFD_PACKAGE, mfd_type) mfd_insert = db_loader.parse_mfd(self.complex, mfd) helpers.assertModelAlmostEqual(self, expected, mfd_insert)
def test_parse_mfd_complex_fault(self): expected = models.MfdTgr( b_val=0.80000000000000004, total_cumulative_rate=4.933442096397671e-10, min_val=6.5499999999999998, max_val=8.9499999999999993, total_moment_rate=198544639016.43918, a_val=1.0) mfd = self.complex.getMfd() mfd_type = mfd.__javaclass__.getName() self.assertEqual( '%s.GutenbergRichterMagFreqDist' % db_loader.MFD_PACKAGE, mfd_type) mfd_insert = db_loader.parse_mfd(self.complex, mfd) helpers.assertModelAlmostEqual(self, expected, mfd_insert)
def test_parse_mfd_complex_fault(self): expected = { 'table': 'hzrdi.mfd_tgr', 'data': { 'b_val': 0.80000000000000004, 'total_cumulative_rate': 4.933442096397671e-10, 'min_val': 6.5499999999999998, 'max_val': 8.9499999999999993, 'total_moment_rate': 198544639016.43918, 'a_val': 1.0, 'owner_id': None}} mfd = self.complex.getMfd() mfd_type = mfd.__javaclass__.getName() self.assertEqual( '%s.GutenbergRichterMagFreqDist' % db_loader.MFD_PACKAGE, mfd_type) mfd_insert = db_loader.parse_mfd(self.complex, mfd) helpers.assertDictAlmostEqual(self, expected, mfd_insert)
def test_parse_mfd_simple_fault(self): expected = { 'table': 'pshai.mfd_evd', 'data': { 'max_val': 6.9500000000000002, 'total_cumulative_rate': 1.8988435199999998e-05, 'min_val': 6.5499999999999998, 'bin_size': 0.10000000000000009, 'mfd_values': [ 0.0010614989, 0.00088291626999999998, 0.00073437776999999999, 0.00061082879999999995, 0.00050806530000000003 ], 'total_moment_rate': 281889786038447.25, 'owner_id': None } } mfd = self.simple.getMfd() # Assume that this is an 'evenly discretized' MFD # We want to do this check so we know right away if our test data # has been altered. mfd_type = mfd.__javaclass__.getName() self.assertEqual('%s.IncrementalMagFreqDist' % db_loader.MFD_PACKAGE, mfd_type) # this is the dict we'll be passing to sqlalchemy to do the db insert mfd_insert = db_loader.parse_mfd(self.simple, mfd) helpers.assertDictAlmostEqual(self, expected, mfd_insert)
def test_parse_mfd_complex_fault(self): expected = { 'table': 'pshai.mfd_tgr', 'data': { 'b_val': 0.80000000000000004, 'total_cumulative_rate': 4.933442096397671e-10, 'min_val': 6.5499999999999998, 'max_val': 8.9499999999999993, 'total_moment_rate': 198544639016.43918, 'a_val': 1.0, 'owner_id': None } } mfd = self.complex.getMfd() mfd_type = mfd.__javaclass__.getName() self.assertEqual( '%s.GutenbergRichterMagFreqDist' % db_loader.MFD_PACKAGE, mfd_type) mfd_insert = db_loader.parse_mfd(self.complex, mfd) helpers.assertDictAlmostEqual(self, expected, mfd_insert)