in submitit/core/utils.py [0:0]
def _format_id(self, path: Union[Path, str]) -> Path:
"""Replace id tag by actual id if available"""
if self.job_id is None:
return Path(path)
replaced_path = str(path).replace("%j", str(self.job_id)).replace("%t", str(self.task_id))
array_id, *array_index = str(self.job_id).split("_", 1)
if "%a" in replaced_path:
if len(array_index) != 1:
raise ValueError("%a is in the folder path but this is not a job array")
replaced_path = replaced_path.replace("%a", array_index[0])
return Path(replaced_path.replace("%A", array_id))