From 272370a45e8e760701e475acbcd4e370e9674527 Mon Sep 17 00:00:00 2001 From: jinyan1214 Date: Fri, 30 Aug 2024 15:08:05 -0700 Subject: [PATCH 1/4] jz - fix a bug of HTA app argument in rwhale --- modules/Workflow/whale/main.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/Workflow/whale/main.py b/modules/Workflow/whale/main.py index 86d0f26ab..732702807 100644 --- a/modules/Workflow/whale/main.py +++ b/modules/Workflow/whale/main.py @@ -1756,10 +1756,6 @@ def perform_regional_mapping(self, AIM_file_path, assetType, doParallel=True): for input_ in reg_mapping_app.inputs: if input_['id'] == 'assetFile': input_['default'] = str(AIM_file_path) - # Get the event file path - eventFilePath = self.shared_data.get('RegionalEvent', {}).get( # noqa: N806 - 'eventFilePath', self.reference_dir - ) reg_mapping_app.inputs.append( { @@ -1767,7 +1763,7 @@ def perform_regional_mapping(self, AIM_file_path, assetType, doParallel=True): 'type': 'path', 'default': resolve_path( self.shared_data['RegionalEvent']['eventFile'], - eventFilePath, + self.reference_dir, ), } ) From f67c15feb7a788dd7283de92b46159ccc742d65e Mon Sep 17 00:00:00 2001 From: jinyan1214 Date: Fri, 30 Aug 2024 15:08:56 -0700 Subject: [PATCH 2/4] jz - fix a format miss match between EQ simulation and R2D --- .../regionalGroundMotion/HazardSimulationEQ.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulationEQ.py b/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulationEQ.py index 3d9eaed21..621cb0511 100644 --- a/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulationEQ.py +++ b/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulationEQ.py @@ -99,6 +99,15 @@ def hazard_job(hazard_info): # noqa: C901, D103, PLR0915 event_info = hazard_info['Event'] # When vector IM is used. The PGA/SA needs to be computed before PGV im_info = event_info['IntensityMeasure'] + # To make the SA format consistent with R2D requirement + if im_info['Type'] == 'Vector' and 'SA' in im_info.keys(): # noqa: SIM118 + periods = im_info['SA']['Periods'] + periods = [float(i) for i in periods] + im_info['SA']['Periods'] = periods + if im_info['Type'] == 'SA': + periods = [im_info['Period']] + periods = [float(i) for i in periods] + im_info['SA']['Periods'] = periods if im_info['Type'] == 'Vector' and 'PGV' in im_info.keys(): # noqa: SIM118 PGV_info = im_info.pop('PGV') # noqa: N806 im_info.update({'PGV': PGV_info}) From ba9cea05f18762f8f6ca85c34c2a9a90971816be Mon Sep 17 00:00:00 2001 From: jinyan1214 Date: Fri, 30 Aug 2024 15:20:00 -0700 Subject: [PATCH 3/4] jz - fix a typo --- .../regionalGroundMotion/HazardSimulationEQ.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulationEQ.py b/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulationEQ.py index 621cb0511..13141556b 100644 --- a/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulationEQ.py +++ b/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulationEQ.py @@ -105,7 +105,7 @@ def hazard_job(hazard_info): # noqa: C901, D103, PLR0915 periods = [float(i) for i in periods] im_info['SA']['Periods'] = periods if im_info['Type'] == 'SA': - periods = [im_info['Period']] + periods = [im_info['Periods']] periods = [float(i) for i in periods] im_info['SA']['Periods'] = periods if im_info['Type'] == 'Vector' and 'PGV' in im_info.keys(): # noqa: SIM118 From ed10bce75544854b2a321ec8546f9d58f87e0176 Mon Sep 17 00:00:00 2001 From: jinyan1214 Date: Fri, 30 Aug 2024 15:39:36 -0700 Subject: [PATCH 4/4] jz - error in pervious fix --- .../regionalGroundMotion/HazardSimulationEQ.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulationEQ.py b/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulationEQ.py index 13141556b..b39773d71 100644 --- a/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulationEQ.py +++ b/modules/performRegionalEventSimulation/regionalGroundMotion/HazardSimulationEQ.py @@ -105,9 +105,9 @@ def hazard_job(hazard_info): # noqa: C901, D103, PLR0915 periods = [float(i) for i in periods] im_info['SA']['Periods'] = periods if im_info['Type'] == 'SA': - periods = [im_info['Periods']] + periods = im_info['Periods'] periods = [float(i) for i in periods] - im_info['SA']['Periods'] = periods + im_info['Periods'] = periods if im_info['Type'] == 'Vector' and 'PGV' in im_info.keys(): # noqa: SIM118 PGV_info = im_info.pop('PGV') # noqa: N806 im_info.update({'PGV': PGV_info})