@@ -1367,8 +1367,8 @@ def replace_parameter_inside_section(content, parameter, new_value, section):
13671367 return content
13681368
13691369 @staticmethod
1370- def as_conf_default_values (exp_id , hpc , minimal_configuration = False , git_repo = "" , git_branch = "main " ,
1371- git_as_conf = "" ):
1370+ def as_conf_default_values (exp_id : str , hpc : str = "local" , minimal_configuration : bool = False , git_repo : str = " " ,
1371+ git_branch : str = "main" , git_as_conf : str = "" ) -> None :
13721372 """
13731373 Replace default values in as_conf files
13741374 :param exp_id: experiment id
@@ -1380,7 +1380,6 @@ def as_conf_default_values(exp_id, hpc, minimal_configuration=False, git_repo=""
13801380 :return: None
13811381 """
13821382 # the var hpc was hardcoded in the header of the function
1383- hpc_default = "local"
13841383
13851384 # open and replace values
13861385 for as_conf_file in Path (BasicConfig .LOCAL_ROOT_DIR , f"{ exp_id } /conf" ).iterdir ():
@@ -1404,12 +1403,13 @@ def as_conf_default_values(exp_id, hpc, minimal_configuration=False, git_repo=""
14041403 x = search .group (0 ).split (":" )
14051404 # clean blank space, quotes and double quote
14061405 aux = x [1 ].strip (' "\' ' )
1407- # hpc in config is empty && -H is empty-> hpc_default will be introduced
1408- if len (aux ) == 0 and not hpc :
1409- content = content .replace (search .group (0 ), f"HPCARCH: \" { hpc_default } \" " )
14101406 # hpc in config is empty && -H has a value-> write down hpc value
1411- elif len ( aux ) == 0 :
1407+ if hpc != "" :
14121408 content = content .replace (search .group (0 ), f"HPCARCH: \" { hpc } \" " )
1409+ elif len (aux ) > 0 :
1410+ content = content .replace (search .group (0 ), f"HPCARCH: \" { aux } \" " )
1411+ else :
1412+ content = content .replace (search .group (0 ), "HPCARCH: \" local\" " )
14131413 # the other case is aux!=0 that we dont care about val(hpc) because its a copyExpId
14141414 if minimal_configuration :
14151415 search = re .search ('CUSTOM_CONFIG: .*' , content , re .MULTILINE )
0 commit comments