@@ -74,8 +74,20 @@ def create_event(asset_file: str, event_grid_file: str, workflow_input: str, do_
7474
7575 event_grid_file_path = os .path .dirname (event_grid_file )
7676
77+ #
78+ # open input file & get Regional Event data
79+ #
80+
81+ json_path = os .path .join (os .getcwd (), workflow_input )
82+ print (json_path )
83+
84+ with open (json_path , 'r' ) as f :
85+ data = json .load (f )
86+
87+ regional_event = data .get ("RegionalEvent" )
88+
7789 if is_raster_file (event_grid_file ):
78- create_raster_event (asset_file , event_grid_file , 0 , do_parallel )
90+ create_raster_event (asset_file , event_grid_file , 0 , do_parallel , regional_event )
7991 elif is_xml_file (event_grid_file ): # noqa: RET505
8092 # Here you would call a function to handle XML files
8193 # For now, we'll just raise a NotImplementedError
@@ -85,15 +97,6 @@ def create_event(asset_file: str, event_grid_file: str, workflow_input: str, do_
8597 f'{ event_grid_file } is not a raster. Only rasters are currently supported.' # noqa: EM102
8698 )
8799
88- #
89- # open input file, see if other raster files to deal with
90- #
91-
92- # path to file and open it
93- json_path = os .path .join (os .path .dirname (os .getcwd ()), workflow_input )
94- with open (json_path , 'r' ) as f :
95- data = json .load (f )
96-
97100 #
98101 # If multiple exists, update event_file
99102 # note: create_raster_event modified for this purpose
@@ -107,11 +110,11 @@ def create_event(asset_file: str, event_grid_file: str, workflow_input: str, do_
107110 # is this assumption correct on file paths?
108111 next_file = data ['RegionalEvent' ]['multiple' ][i ]['eventFile' ]
109112 next_file_path = os .path .join (event_grid_file_path , next_file )
110- create_raster_event (asset_file , next_file_path , i + 1 , do_parallel )
111-
113+ create_raster_event (asset_file , next_file_path , i + 1 , do_parallel , regional_event )
112114
113-
114-
115+ #
116+ # main function
117+ #
115118
116119if __name__ == '__main__' :
117120 parser = argparse .ArgumentParser ()
0 commit comments