@@ -132,18 +132,15 @@ class RuptureProperties)
132132 # build our dataframe data (horizontal concat data + meta_data into data):
133133 data .append (meta_data )
134134 # build our dataframe columns (append the meta_data columns from meta_columns):
135- meta_columns = [
136- (Clabel .input , str (column_type (m ).value ), m ) for m in meta_fields
137- ]
135+ meta_columns = [(Clabel .input , str (column_type (m ).value ), m ) for m in meta_fields ]
138136 columns .extend (meta_columns )
139137
140138 # compute final DataFrame:
141139 output = pd .DataFrame (columns = columns , data = np .hstack (data ))
142140
143141 # sort columns (maybe we could use reindex but let's be more explicit):
144142 computed_cols = set (output .columns )
145- expected_cols = \
146- list (product (imts , [Clabel .median , Clabel .std ], gsims )) + meta_columns
143+ expected_cols = list (product (imts , [Clabel .median , Clabel .std ], gsims )) + meta_columns
147144 output = output [[c for c in expected_cols if c in computed_cols ]].copy ()
148145 if header_sep :
149146 output .columns = [header_sep .join (c ) for c in output .columns ]
@@ -242,8 +239,7 @@ def create_planar_surface(
242239 :param aspect: Aspect ratio of rupture
243240 :param ztor: top of rupture depth, in km
244241
245- :return: Rupture as an instance of
246- :class:`openquake.hazardlib.geo.surface.planar.PlanarSurface`
242+ :return: Rupture as instance of :class:`openquake.hazardlib.geo.surface.planar.PlanarSurface`
247243 """
248244 # If the top of rupture depth in the initial
249245 if fabs (top_centroid .depth - ztor ) > 1E-9 :
@@ -362,8 +358,7 @@ def get_hypocentre_on_planar_surface(
362358 a hypocentre located in a position 3/4 along the length, and 1/4 of the
363359 way down dip of the rupture plane would be entered as (0.75, 0.25)
364360
365- :return: Hypocentre location as instance of
366- :class:`openquake.hazardlib.geo.point.Point`
361+ :return: Hypocentre location as instance of :class:`openquake.hazardlib.geo.point.Point`
367362 """
368363 centroid = plane .get_middle_point ()
369364 if hypo_loc is None :
@@ -412,17 +407,18 @@ def _rup_to_point(
412407 dist_sin_dip = distance / sin_dip
413408 iterval = 0
414409 while (np .fabs (r_diff ) >= iter_stop ) and (iterval <= maxiter ):
415- pt1mesh = Mesh (np .array ([pt1 .longitude ]),
416- np .array ([pt1 .latitude ]),
417- None )
410+ pt1mesh = Mesh (
411+ np .array ([pt1 .longitude ]),
412+ np .array ([pt1 .latitude ]),
413+ None
414+ )
418415 if distance_type == 'rjb' or np .fabs (dip - 90.0 ) < 1.0E-3 :
419416 r_diff = (distance - surface .get_joyner_boore_distance (pt1mesh )).flatten ()
420417 pt0 = Point (pt1 .longitude , pt1 .latitude )
421418 if r_diff > 0. :
422419 pt1 = pt0 .point_at (r_diff , 0. , azimuth )
423420 else :
424- pt1 = pt0 .point_at (np .fabs (r_diff ), 0. ,
425- (azimuth + 180. ) % 360. )
421+ pt1 = pt0 .point_at (np .fabs (r_diff ), 0. , (azimuth + 180. ) % 360. )
426422 elif distance_type == 'rrup' :
427423 rrup = surface .get_min_distance (pt1mesh ).flatten ()
428424 if 0.0 <= azimuth <= 180.0 :
@@ -435,8 +431,7 @@ def _rup_to_point(
435431 if r_diff > 0. :
436432 pt1 = pt0 .point_at (r_diff , 0. , azimuth )
437433 else :
438- pt1 = pt0 .point_at (np .fabs (r_diff ), 0. ,
439- (azimuth + 180. ) % 360. )
434+ pt1 = pt0 .point_at (np .fabs (r_diff ), 0. , (azimuth + 180. ) % 360. )
440435 else :
441436 raise ValueError ('Distance type must be rrup or rjb' )
442437 iterval += 1
0 commit comments