Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
CB-quakemodel committed Jul 5, 2024
1 parent 51fd29f commit e65db46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
8 changes: 4 additions & 4 deletions openquake/smt/residuals/sm_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from openquake.smt.sm_utils import vs30_to_z1pt0_as08, z1pt0_to_z2pt5
from openquake.smt.sm_utils import vs30_to_z1pt0_cy14, vs30_to_z2pt5_cb14
import openquake.smt.sm_utils as utils
from openquake.smt import surface_utils
from openquake.smt.residuals import sm_database_surface_utils
from openquake.smt.residuals.context_db import ContextDB
from openquake.hazardlib.geo import geodetic

Expand Down Expand Up @@ -175,7 +175,7 @@ def to_dict(self):
self.hypocentre.latitude,
self.hypocentre.depth]
elif key == "surface" and self.surface is not None:
output[key] = surface_utils.surfaces_to_dict[
output[key] = sm_database_surface_utils.surfaces_to_dict[
self.surface.__class__.__name__](self.surface)
else:
output[key] = getattr(self, key)
Expand All @@ -193,8 +193,8 @@ def from_dict(cls, data, mesh_spacing=1.):
if key in ["id", "name", "magnitude", "length", "width", "depth"]:
continue
elif key == "surface" and data["surface"] is not None:
rup.surface = surface_utils.surfaces_from_dict(data[key]["type"],
mesh_spacing)
rup.surface = sm_database_surface_utils.surfaces_from_dict(
data[key]["type"], mesh_spacing)
else:
setattr(rup, key, data[key])
return rup
Expand Down
10 changes: 1 addition & 9 deletions openquake/smt/surface_utils.py → ...mt/residuals/sm_database_surface_utils.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,4 @@ def multi_surface_from_dict(data, mesh_spacing=1.):
return MultiSurface(surfaces)


surfaces_from_dict["MultiSurface"] = multi_surface_from_dict


# surfaces_to_dict = {
# "PlanarSurface": planar_fault_surface_to_dict,
# "SimpleFaultSurface": simple_fault_surface_to_dict,
# "ComplexFaultSurface": complex_fault_surface_to_dict,
# "MultiSurface": multi_surface_to_dict
# }
surfaces_from_dict["MultiSurface"] = multi_surface_from_dict

0 comments on commit e65db46

Please sign in to comment.