Skip to content

Commit 650c939

Browse files
committed
kz - linking to opensha 25.4.1
1 parent 4348d61 commit 650c939

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulation.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151

5252
R2D = True
5353

54+
OPENSHA_JAR = 'opensha-all.jar' # version 25.4.1 (invoked in 04/2026)
55+
5456

5557
def site_job(hazard_info): # noqa: C901, D103
5658
# Sites and stations
@@ -542,12 +544,14 @@ def hazard_job(hazard_info): # noqa: C901, D103, PLR0915
542544

543545
memory_total = psutil.virtual_memory().total / (1024.0**3)
544546
memory_request = int(memory_total * 0.75)
545-
jpype.addClassPath('./lib/OpenSHA-1.5.2.jar')
547+
#jpype.addClassPath('./lib/OpenSHA-1.5.2.jar') # not supported by opensha starting from 02/2026
548+
jpype.addClassPath('./lib/{}'.format(OPENSHA_JAR))
546549
try:
547550
jpype.startJVM(f'-Xmx{memory_request}G', convertStrings=False)
548551
except: # noqa: E722
549552
print( # noqa: T201
550-
f'StartJVM of ./lib/OpenSHA-1.5.2.jar with {memory_request} GB Memory fails. Try again after releasing some memory'
553+
#f'StartJVM of ./lib/OpenSHA-1.5.2.jar with {memory_request} GB Memory fails. Try again after releasing some memory'
554+
f'StartJVM of ./lib/{OPENSHA_JAR} with {memory_request} GB Memory fails. Try again after releasing some memory'
551555
)
552556
if oq_flag:
553557
# clear up old db.sqlite3 if any

modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulationEQ.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252

5353
R2D = True
5454

55+
OPENSHA_JAR = 'opensha-all.jar' # version 25.4.1 (invoked in 04/2026)
5556

5657
def hazard_job(hazard_info): # noqa: C901, D103, PLR0915
5758
from CreateScenario import load_ruptures_openquake
@@ -578,7 +579,8 @@ def hazard_job(hazard_info): # noqa: C901, D103, PLR0915
578579

579580
memory_total = psutil.virtual_memory().total / (1024.0**3)
580581
memory_request = int(memory_total * 0.75)
581-
jpype.addClassPath('./lib/OpenSHA-1.5.2.jar')
582+
#jpype.addClassPath('./lib/OpenSHA-1.5.2.jar') # not supported by opensha starting from 02/2026
583+
jpype.addClassPath('./lib/{}'.format(OPENSHA_JAR))
582584
jpype.startJVM(f'-Xmx{memory_request}G', convertStrings=False)
583585
if oq_flag:
584586
# clear up old db.sqlite3 if any

modules/performRegionalEventSimulation/regionalGroundMotion/ScenarioForecast.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747

4848
import psutil
4949

50+
OPENSHA_JAR = 'opensha-all.jar' # version 25.4.1 (invoked in 04/2026)
51+
5052
if __name__ == '__main__':
5153
# parse arguments
5254
parser = argparse.ArgumentParser()
@@ -112,7 +114,8 @@
112114

113115
memory_total = psutil.virtual_memory().total / (1024.0**3)
114116
memory_request = int(memory_total * 0.75)
115-
jpype.addClassPath('./lib/OpenSHA-1.5.2.jar')
117+
#jpype.addClassPath('./lib/OpenSHA-1.5.2.jar') # not supported by opensha starting from 02/2026
118+
jpype.addClassPath('./lib/{}'.format(OPENSHA_JAR))
116119
jpype.startJVM(f'-Xmx{memory_request}G', convertStrings=False)
117120
from CreateScenario import (
118121
create_earthquake_scenarios,

0 commit comments

Comments
 (0)