Skip to content

Commit

Permalink
Merge pull request #90 from kuanshi/master
Browse files Browse the repository at this point in the history
kz - minor patches for python packages and OQ exceptions in regionalGroundMotion
  • Loading branch information
fmckenna authored Jun 25, 2021
2 parents 840641a + 133646a commit 48ae8bd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import json
import numpy as np
import pandas as pd
import requests


def get_label(options, labels, label_name):
Expand Down Expand Up @@ -407,6 +406,8 @@ def get_zTR_ncm(lat, lon):
Output:
zTR: list of depth to bedrock
"""
import requests

zTR = []

# Looping over sites
Expand Down Expand Up @@ -439,6 +440,8 @@ def get_vsp_ncm(lat, lon, depth):
Output:
vsp: list of shear-wave velocity profile
"""
import requests

vsp = []
depthMin, depthInc, depthMax = [abs(x) for x in depth]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,19 @@ def handleError(func, path, exc_info):
if not os.path.isdir('./oq-engine'):
try:
os.system('git clone https://github.com/gem/oq-engine.git')
# switch to the stable version
owd = os.getcwd()
os.chdir('./oq-engine')
os.system('git clean -d -f')
os.system('git checkout '+oq_version)
os.chdir(owd)
try:
# switch to the stable version
owd = os.getcwd()
os.chdir('./oq-engine')
os.system('git clean -d -f')
os.system('git checkout '+oq_version)
os.chdir(owd)
except:
print('FetchOpenQuake: failed to switch to the OpenQuake commit '+oq_version)
except:
shutil.rmtree('oq-engine', onerror=handleError)
print('FetchOpenQuake: could not clone https://github.com/gem/oq-engine.git')
shutil.copytree('./oq-engine/openquake',os.path.dirname(os.path.realpath(__file__))+'/openquake')
shutil.copytree('./oq-engine/openquake',os.path.dirname(os.path.realpath(__file__))+'/openquake',symlinks=True)
shutil.rmtree('oq-engine', onerror=handleError)

from openquake.baselib import config, version, performance, general, zeromq, hdf5, parallel
Expand Down

0 comments on commit 48ae8bd

Please sign in to comment.