@@ -55,8 +55,8 @@ def __init__(self,
5555 server : str = None ,
5656 testing : bool = False ,
5757 ):
58- self .rmg = rmg
59- self .t3 = t3
58+ self .rmg = rmg . copy ()
59+ self .t3 = t3 . copy ()
6060 self .iteration = iteration
6161 self .paths = paths
6262 self .walltime = walltime
@@ -84,6 +84,26 @@ def __init__(self,
8484 self .rmg_errors = list ()
8585 self .rmg_run_count = 0
8686 self .cont_run_rmg = True
87+ self .dict_of_custom_libraries = dict ()
88+ if self .rmg_execution_type == 'queue' :
89+ self .set_file_paths ()
90+ # We need to check if the strings in the rmg database kintetic library are path to the files
91+ for library_key , library_value in self .rmg ['database' ].items ():
92+ if isinstance (library_value , list ):
93+ for library_item in range (len (library_value )):
94+ if os .path .isdir (self .rmg ['database' ][library_key ][library_item ]):
95+
96+ # Make the library item name the key, and then inside that key there are two keys: local and remote
97+ # The local key will be the path to the library item on the local machine
98+ # The remote key will be the path to the library item on the remote machine
99+ if os .path .basename (self .rmg ['database' ][library_key ][library_item ]) not in self .dict_of_custom_libraries :
100+ self .dict_of_custom_libraries [os .path .basename (self .rmg ['database' ][library_key ][library_item ])] = dict ()
101+ self .dict_of_custom_libraries [os .path .basename (self .rmg ['database' ][library_key ][library_item ])]['local' ] = self .rmg ['database' ][library_key ][library_item ]
102+ self .dict_of_custom_libraries [os .path .basename (self .rmg ['database' ][library_key ][library_item ])]['remote' ] = os .path .join (self .remote_path , os .path .basename (self .rmg ['database' ][library_key ][library_item ]))
103+ # Add the library item to the dict of custom libraries
104+ # We now need to change it's path to the path on the server
105+ self .rmg ['database' ][library_key ][library_item ] = os .path .join (self .remote_path , os .path .basename (self .rmg ['database' ][library_key ][library_item ]))
106+
87107
88108 def run_rmg (self ):
89109 """
@@ -483,6 +503,16 @@ def set_files(self) -> None:
483503 file_name = submit_filenames [CLUSTER_SOFT ]))
484504 # 1.2. RMG input file
485505 self .write_rmg_input_file ()
506+ # 1.3 Custom Libraries
507+ # Need to upload the custom libraries if they exist and are not already uploaded
508+ if self .dict_of_custom_libraries :
509+ for lib_name , lib_paths in self .dict_of_custom_libraries .items ():
510+ if lib_paths ['local' ] not in self .files_to_upload :
511+ self .files_to_upload .append (self .get_file_property_dictionary (
512+ file_name = lib_name ,
513+ local = lib_paths ['local' ],
514+ remote = lib_paths ['remote' ]))
515+
486516 # If this a restart, we need to upload the restart file
487517 if self .restart_rmg :
488518 restart_string = "restartFromSeed(path='seed')"
0 commit comments