Skip to content

Commit

Permalink
Merge pull request #9285 from gem/pep8
Browse files Browse the repository at this point in the history
Some PEP8 fixes
  • Loading branch information
micheles authored Dec 18, 2023
2 parents 6d25291 + 5faf9f5 commit 32e0c9c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
2 changes: 0 additions & 2 deletions openquake/hazardlib/gsim/abrahamson_gulerce_2020.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@
"c": 1.88,
"tau_lin": 0.47,
"phi_amp": 0.3,
"d0": 0.47,
"alpha_phi3": 0.42,
"T1_phi2": 0.03,
"T2_phi2": 0.075,
Expand All @@ -130,7 +129,6 @@
"d3_phi3": 0.242,
"d4_phi3": 0.000,
"d5_phi3": 0.000,
"phi_amp": 0.3,
}


Expand Down
5 changes: 0 additions & 5 deletions openquake/hazardlib/gsim/bahrampouri_2021.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,9 @@
class:`bahrampouriEtAl2021SInter`,
"""
import numpy as np
import pandas as pd
from openquake.hazardlib.gsim.base import GMPE, CoeffsTable
from openquake.hazardlib import const
from openquake.hazardlib.imt import IA
from scipy.interpolate import interp1d
from math import sin, cos, sqrt, atan2, radians
from openquake.hazardlib.geo.geodetic import npoints_towards
from openquake.hazardlib.geo import Point
import shapely.geometry as sg
from shapely.geometry import LineString

Expand Down
20 changes: 10 additions & 10 deletions openquake/hazardlib/gsim/nz22/stafford_2022.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,42 +151,42 @@ def get_adjustments (T, ctx, adjust_c1, adjust_chm, adjust_c7, adjust_cg1):
MEAN_ADJUSTMENT_TERMS_IF = {
"Lower": {
'delta_c1':(-1.28155 * epistemic_scale_factor * _empirical_sigma(T, ctx.rrup, ctx.mag)
if adjust_c1==True
if adjust_c1 is True
else 0.0),
'delta_c1hm':(-1.28155 * epistemic_scale_factor * ρEhEx * _saturation_sigma(ctx.mag, ctx.rrup)
if adjust_chm==True
if adjust_chm is True
else 0.0),
'delta_c7':(-0.02578
if adjust_c7==True
if adjust_c7 is True
else 0.0),
'delta_c7b':(_sigmoid1d(np.log(T), -0.05737, 0.05733, -1.0324, 0.04875)
if adjust_c7==True
if adjust_c7 is True
else 0.0),
'delta_cg1':(_anelastic_correction(T) - 1.28155 * epistemic_scale_factor * _anelastic_sigma(T)
if adjust_cg1==True
if adjust_cg1 is True
else 0.0),
},
"Central":{'delta_c1': 0.0,
'delta_c1hm' : 0.0,
'delta_c7':0.0,
'delta_c7b':(_sigmoid1d(np.log(T), -0.0865, 0.0, -1.5364, 0.3266)
if adjust_c7==True
if adjust_c7 is True
else 0.0),
'delta_cg1':(_anelastic_correction(T)
if adjust_cg1==True
if adjust_cg1 is True
else 0.0),
},
"Upper":{
'delta_c1':(1.28155 * epistemic_scale_factor * _empirical_sigma(T, ctx.rrup, ctx.mag)
if adjust_c1==True
if adjust_c1 is True
else 0.0),
'delta_c1hm':(1.28155 * epistemic_scale_factor * ρEhEx * _saturation_sigma(ctx.mag, ctx.rrup)
if adjust_chm==True
if adjust_chm is True
else 0.0),
'delta_c7': 0.0,
'delta_c7b':0.0,
'delta_cg1':(_anelastic_correction(T) + 1.28155 * epistemic_scale_factor * _anelastic_sigma(T)
if adjust_cg1==True
if adjust_cg1 is True
else 0.0),
}
}
Expand Down
4 changes: 2 additions & 2 deletions openquake/hazardlib/gsim/zhao_2016_volc_perg/volc_perg.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ def get_dist_traversed_per_zone(l_mesh, pgn_store, pgn_zone, ctx):
checks = pgn_zone[zone_id].intersects(l_mesh[idx_path])

# N points in zone * line spacing = distance in zone
r_per_zone = len(np.argwhere(checks == True)) * line_spacing
r_per_zone = len(np.argwhere(checks)) * line_spacing
r_zone_path[idx_path][zone_id] = r_per_zone

# Get coordinates of mesh points in zone
in_zone_lons, in_zone_lats = [], []
for idx_pnt, pnt in enumerate(checks):
if checks[idx_pnt] == True:
if checks[idx_pnt]:
in_zone_lons.append(mesh_lons[idx_pnt])
in_zone_lats.append(mesh_lats[idx_pnt])
pnts_in_zone[idx_path][zone_id] = [in_zone_lons, in_zone_lats]
Expand Down

0 comments on commit 32e0c9c

Please sign in to comment.