Filenames

Management of the file names

biogeme.filenames module

Implements the function providing names for the output files.

author:

Michel Bierlaire

date:

Tue Mar 26 16:48:40 2019

biogeme.filenames.getNewFileName(name, ext)[source]

Old version.

Parameters:
  • name (str) – name of the file.

  • ext (str) – file extension.

Return type:

str

Returns:

name.ext if the file does not exists. If it does, returns name~xx.ext, where xx is the smallest integer such that the corresponding file does not exist. It is designed to avoid erasing output files inadvertently.

biogeme.filenames.get_new_file_name(name, ext)[source]

Generate a file name that does not exist.

Parameters:
  • name (str) – name of the file.

  • ext (str) – file extension.

Return type:

str

Returns:

name.ext if the file does not exists. If it does, returns name~xx.ext, where xx is the smallest integer such that the corresponding file does not exist. It is designed to avoid erasing output files inadvertently.