Example #1
0
 def test(self):
     mod = mock.Mock(
         reference_vs30_value=760,
         reference_vs30_type='measured',
         reference_depth_to_1pt0km_per_sec=100.,
         reference_depth_to_2pt5km_per_sec=5.0,
         reference_backarc=False)
     sitecol = site.SiteCollection.from_points(
         [102.32], [-2.9107], [0], mod)
     [[src]] = nrml.to_python(self.bad_source)
     with self.assertRaises(AttributeError) as ctx, context(src):
         max_dist = 250
         # NB: with a distance of 200 km the error does not happen
         src.filter_sites_by_distance_to_source(max_dist, sitecol)
     self.assertIn('An error occurred with source id=61',
                   str(ctx.exception))
Example #2
0
 def test(self):
     mod = mock.Mock(
         reference_vs30_value=760,
         reference_vs30_type='measured',
         reference_depth_to_1pt0km_per_sec=100.,
         reference_depth_to_2pt5km_per_sec=5.0,
         reference_backarc=False)
     sitecol = site.SiteCollection.from_points([102.32], [-2.9107], mod)
     parser = SourceModelParser(s.SourceConverter(
         investigation_time=50.,
         rupture_mesh_spacing=1,  # km
         complex_fault_mesh_spacing=1,  # km
         width_of_mfd_bin=1.,  # for Truncated GR MFDs
         area_source_discretization=1.,  # km
     ))
     [[src]] = parser.parse_groups(self.bad_source)
     with self.assertRaises(AttributeError) as ctx, context(src):
         max_dist = 250
         # NB: with a distance of 200 km the error does not happen
         src.filter_sites_by_distance_to_source(max_dist, sitecol)
     self.assertIn('An error occurred with source id=61',
                   str(ctx.exception))
Example #3
0
 def test(self):
     mod = mock.Mock(reference_vs30_value=760,
                     reference_vs30_type='measured',
                     reference_depth_to_1pt0km_per_sec=100.,
                     reference_depth_to_2pt5km_per_sec=5.0,
                     reference_backarc=False)
     sitecol = site.SiteCollection.from_points([102.32], [-2.9107], [0],
                                               mod)
     parser = nrml.SourceModelParser(
         s.SourceConverter(
             investigation_time=50.,
             rupture_mesh_spacing=1,  # km
             complex_fault_mesh_spacing=1,  # km
             width_of_mfd_bin=1.,  # for Truncated GR MFDs
             area_source_discretization=1.,  # km
         ))
     [[src]] = parser.parse_groups(self.bad_source)
     with self.assertRaises(AttributeError) as ctx, context(src):
         max_dist = 250
         # NB: with a distance of 200 km the error does not happen
         src.filter_sites_by_distance_to_source(max_dist, sitecol)
     self.assertIn('An error occurred with source id=61',
                   str(ctx.exception))